-
Notifications
You must be signed in to change notification settings - Fork 122
34 lines (32 loc) · 1.06 KB
/
push-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: push-pr
run-name: Create/Update pr${{ inputs.prNumber }} branch
on:
workflow_dispatch:
inputs:
prNumber:
description: 'PR number'
required: true
type: string
# we decided not to have 'workflow_run' here (chained off CI success) for 'trusted' forks, as we don't know/control the
# access control etc. - so keeping it manual only (via workflow_dispatch above)
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run:
jobs:
push-pr:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v4
- name: push-pr
env:
PR: ${{ inputs.prNumber }}
run: |
echo "Pushing PR merge commit for ${PR} to remote pr${PR} branch"
git fetch -f origin pull/${PR}/merge:pr${PR}
git push -f origin pr${PR}:pr${PR}
- name: trigger CI
env:
PR: ${{ inputs.prNumber }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run ci.yml --ref pr${PR}