From 1ed0959aeab11293b262a5797b0def7e85505331 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 16 Mar 2024 10:32:13 +0100 Subject: [PATCH] Automatically add internal labels --- .github/workflows/label-pull-requests.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/label-pull-requests.yml b/.github/workflows/label-pull-requests.yml index 816f42cf420..1c56460d9a2 100644 --- a/.github/workflows/label-pull-requests.yml +++ b/.github/workflows/label-pull-requests.yml @@ -12,4 +12,16 @@ jobs: pull-requests: write steps: - # Todo + # If PR title starts with "Internal: " then add the "Internal" label + - name: Label Internal Pull Requests + if: "startsWith(github.event.pull_request.title, 'Internal: ')" + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['Internal'] + })