Skip to content

Commit

Permalink
Bug 1853618 - address issue with GitHub PR closer, and optimise r=hwi…
Browse files Browse the repository at this point in the history
…ne DONTBUILD

- run action in the context of the target repo, rather than the fork
- use a cleaner way to obtain the pull request number
- utilise a sparse checkout to avoid unnecessary I/O

Differential Revision: https://phabricator.services.mozilla.com/D188430
  • Loading branch information
globau committed Sep 20, 2023
1 parent 18087b3 commit fe2d53e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/close-pr.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: close pull request
on:
pull_request:
pull_request_target:
types: [opened, reopened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
sparse-checkout: "README.txt"
sparse-checkout-cone-mode: false
- name: close
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.number }}
run: |
PR=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
gh pr close $PR --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html"
gh pr lock $PR
gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html"
gh pr lock ${{ env.PR }}

0 comments on commit fe2d53e

Please sign in to comment.