diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..4f47db56a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: Add Label to PR + +on: + pull_request: + types: [opened] + +jobs: + add-label: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Add label to PR + uses: actions/github-script@v6 + with: + script: | + const prNumber = context.payload.pull_request.number; + const repoOwner = context.repo.owner; + const repoName = context.repo.repo; + const label = 'APPROVED_FOR_CI'; + + await github.issues.addLabels({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + labels: [label], + });