Skip to content

Commit

Permalink
Merge pull request #4240 from guardian/move_push-pr_script_to_GHA
Browse files Browse the repository at this point in the history
replace `dev/script/push-pr.sh` with an equivalent GHA
  • Loading branch information
twrichards authored Jan 25, 2024
2 parents f4a5857 + 7c0c144 commit 35bc77f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/push-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: push-pr
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
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}
16 changes: 0 additions & 16 deletions dev/script/push-pr.sh

This file was deleted.

0 comments on commit 35bc77f

Please sign in to comment.