aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/auto-approve-run.yml
blob: b5296f7943d582def336f77fb9f316a88a878ec0 (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
name: Auto-Approve Safe PRs (workflow-run)
on:
  workflow_run:
    workflows: [Auto-Approve Safe PRs]
    types:
      - completed
permissions: {}
jobs:
  auto-approve-run:
    runs-on: ubuntu-latest
    environment: themoeway-bot
    permissions:
      pull-requests: write
    if: github.actor == 'djahandarie'
    steps:
      - name: Download workflow artifact
        uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d # v3.0.0
        with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            workflow: auto-approve.yml
            run_id: ${{ github.event.workflow_run.id }}
      - name: Read the pr_num file
        id: pr_num_reader
        uses: juliangruber/read-file-action@02bbba9876a8f870efd4ad64e3b9088d3fb94d4b # v1.1.6
        with:
            path: ./pr_num/pr_num.txt
      - uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1
        with:
          pull-request-number: ${{ steps.pr_num_reader.outputs.content }}
          github-token: ${{ secrets.THEMOEWAY_BOT_PAT }}