From 7e00e32282e05c3179f13045a061125cfaa139ce Mon Sep 17 00:00:00 2001 From: surchs Date: Thu, 21 Mar 2024 23:02:52 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.github/workfl?= =?UTF-8?q?ows/'=20with=20remote=20'template=5Fworkflows/project=5Fautomat?= =?UTF-8?q?ion/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/handle_external_pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/handle_external_pr.yml diff --git a/.github/workflows/handle_external_pr.yml b/.github/workflows/handle_external_pr.yml new file mode 100644 index 0000000..3c89948 --- /dev/null +++ b/.github/workflows/handle_external_pr.yml @@ -0,0 +1,21 @@ +name: Label pull requests from forks + +on: + pull_request: + types: [opened] + +jobs: + handle_external_pr: + # Only run this entire workflow if the PR was opened from a forked repo + # The reasoning is that both bots and external contributors have to make + # a fork of the repo before they can open a PR because they don't have + # write access to the repo. + if: github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + + steps: + - name: Label pull request with "_community" + run: gh pr edit ${{ github.event.pull_request.number }} --add-label "_community" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} \ No newline at end of file