Updated review-bot to obtain number from event (#4271)

It seems that `review-trigger` is not uploading the artifact that is
used by `review-bot`, so I changed the PR-Number to be obtained by the
previous event that triggered this action.

I also took the liberty to replace `tibdex/github-app-token` for
`actions/create-github-app-token` which is GitHub's official app.
This commit is contained in:
Javier Bullrich
2024-04-24 16:54:07 +02:00
committed by GitHub
parent ac473cfa7b
commit d29c3636fa
2 changed files with 7 additions and 24 deletions
+5 -9
View File
@@ -11,22 +11,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: master environment: master
steps: steps:
- name: Extract content of artifact
id: number
uses: Bullrich/extract-text-from-artifact@v1.0.0
with:
artifact-name: pr_number
- name: Generate token - name: Generate token
id: app_token id: app_token
uses: tibdex/github-app-token@v1 uses: actions/create-github-app-token@v1.9.3
with: with:
app_id: ${{ secrets.REVIEW_APP_ID }} app-id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }} private-key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers" - name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.4.0 uses: paritytech/review-bot@v2.4.0
with: with:
repo-token: ${{ steps.app_token.outputs.token }} repo-token: ${{ steps.app_token.outputs.token }}
team-token: ${{ steps.app_token.outputs.token }} team-token: ${{ steps.app_token.outputs.token }}
checks-token: ${{ steps.app_token.outputs.token }} checks-token: ${{ steps.app_token.outputs.token }}
pr-number: ${{ steps.number.outputs.content }} # This is extracted from the triggering event
pr-number: ${{ github.event.workflow_run.pull_requests[0].number }}
request-reviewers: true request-reviewers: true
-13
View File
@@ -58,16 +58,3 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
COMMENTS: ${{ steps.comments.outputs.users }} COMMENTS: ${{ steps.comments.outputs.users }}
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Saving PR number: $PR_NUMBER"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5