summaryrefslogtreecommitdiff
path: root/.github/workflows/merged-prs.yml
blob: 107bbc51b5314fdf8e1599e2c7231583799fa461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "Add buildbot information to first PRs from new contributors"

permissions:
  contents: read

on:
  # It's safe to use pull_request_target here, because we aren't checking out
  # code from the pull request branch.
  # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
  pull_request_target:
    types:
      - closed

jobs:
  buildbot_comment:
    runs-on: ubuntu-24.04
    permissions:
      pull-requests: write
    if: >-
      (github.repository == 'llvm/llvm-project') &&
      (github.event.pull_request.merged == true)
    steps:
      - name: Checkout Automation Script
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          sparse-checkout: llvm/utils/git/
          ref: main

      - name: Setup Automation Script
        working-directory: ./llvm/utils/git/
        run: |
          pip install --require-hashes -r requirements.txt

      - name: Add Buildbot information comment
        working-directory: ./llvm/utils/git/
        run: |
          python3 ./github-automation.py \
            --token '${{ secrets.GITHUB_TOKEN }}' \
            pr-buildbot-information \
            --issue-number "${{ github.event.pull_request.number }}" \
            --author "${{ github.event.pull_request.user.login }}"