From de8126e450d8a47e0056cc1448f68ec63201d110 Mon Sep 17 00:00:00 2001 From: tcdsv <33223663+tcdsv@users.noreply.github.com> Date: Sun, 25 Jun 2023 09:09:41 +0300 Subject: [PATCH 1/2] remove instruction for adding Community label manually --- .github/pull_request_template.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 718f0716..80ff933d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,5 @@ Closes # From 1afca192f085c128a38e436072374666c3f41cca Mon Sep 17 00:00:00 2001 From: tcdsv <33223663+tcdsv@users.noreply.github.com> Date: Sun, 25 Jun 2023 09:12:59 +0300 Subject: [PATCH 2/2] Create pr-labels.yml --- .github/workflows/pr-labels.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pr-labels.yml diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml new file mode 100644 index 00000000..d1463eab --- /dev/null +++ b/.github/workflows/pr-labels.yml @@ -0,0 +1,23 @@ +name: PR Labels + +on: + pull_request_target: + types: [opened] + +jobs: + mark_as_community: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Mark as Community if PR is from a fork + if: github.event.pull_request.head.repo.full_name != github.repository + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['Community'] + })