use pull_request_target trigger
on:
- push:
+ pull_request_target:
+ types: [closed, labeled]
branches:
- master
jobs:
backport:
- if: github.repository_owner == 'cupy'
+ if: |
+ github.repository_owner == 'cupy' &&
+ github.event.pull_request.merged == true &&
+ contains(github.event.pull_request.labels.*.name, 'to-be-backported')
runs-on: ubuntu-18.04
env:
CUPY_CI: GitHub
@@ -33,4 +37,4 @@ jobs:
run: |
cd backport
echo -e "machine github.com\nlogin chainer-ci\npassword ${{secrets.BACKPORT_TOKEN}}" > ~/.netrc
- python backport.py --repo cupy --sha ${{github.event.after}} --https
+ python backport.py --repo cupy --pr ${{github.event.number}} --https
