Demo PR #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Main Reviewer Checklist | |
| on: | |
| pull_request: | |
| types: [assigned] | |
| jobs: | |
| checklist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Check out the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # Step 2: Extract the main reviewer (assignee) and PR details | |
| - name: Extract PR details | |
| id: pr_details | |
| run: | | |
| echo "ASSIGNEE=$(jq -r '.assignee.login' < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | |
| # Step 3: Replace the placeholder in the checklist template | |
| - name: Replace reviewer name in checklist template | |
| run: | | |
| ASSIGNEE=${{ env.ASSIGNEE }} | |
| sed "s/__MAINREV__/$ASSIGNEE/g" .github/workflows/main_rev_checklist.md > filled_checklist.md | |
| # Step 4: Post the filled checklist as a comment | |
| - name: Post checklist as a comment | |
| uses: peter-evans/create-or-update-comment@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: filled_checklist.md |