From 3e00c028e29c8cf1fa3a3bab467f3f96e48cf2db Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Mon, 16 Oct 2023 09:44:05 +0200 Subject: [PATCH] added test workflow --- .github/workflows/review-bot.yml | 20 ++++++++++-------- .github/workflows/review-trigger.yml | 31 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/review-trigger.yml diff --git a/.github/workflows/review-bot.yml b/.github/workflows/review-bot.yml index 8c09c37..be9eefb 100644 --- a/.github/workflows/review-bot.yml +++ b/.github/workflows/review-bot.yml @@ -1,14 +1,10 @@ name: Review PR on: - pull_request: + workflow_run: + workflows: + - Review-Trigger types: - - opened - - reopened - - synchronize - - review_requested - - review_request_removed - - ready_for_review - pull_request_review: + - completed permissions: contents: read @@ -18,6 +14,11 @@ jobs: review-approvals: runs-on: ubuntu-latest steps: + - name: Extract content of artifact + id: number + uses: Bullrich/extract-text-from-artifact@main + with: + artifact-name: pr_number - name: Generate token id: team_token uses: tibdex/github-app-token@v1 @@ -27,8 +28,9 @@ jobs: # !This must always point to main. # Change it for the PRs but remember to change it back - name: "Evaluates PR reviews and assigns reviewers" - uses: paritytech/review-bot@main + uses: paritytech/review-bot@test-branch with: repo-token: ${{ secrets.GITHUB_TOKEN }} team-token: ${{ steps.team_token.outputs.token }} checks-token: ${{ steps.team_token.outputs.token }} + pr-number: ${{ steps.number.outputs.content }} diff --git a/.github/workflows/review-trigger.yml b/.github/workflows/review-trigger.yml new file mode 100644 index 0000000..40e2918 --- /dev/null +++ b/.github/workflows/review-trigger.yml @@ -0,0 +1,31 @@ +name: Review-Trigger + +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - review_requested + - review_request_removed + - ready_for_review + pull_request_review: + +jobs: + trigger-review-bot: + runs-on: ubuntu-latest + name: trigger review bot + steps: + - 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