-
Notifications
You must be signed in to change notification settings - Fork 0
Testing PR config #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
505f85a
Add main reviewer checklist section to README
RayStick 94d8cf8
two types of reviewer
RayStick 5c35e9b
Create rev_checklist.md
RayStick 6030291
checklist for rev_checklist.md
RayStick d3c1b1b
Update Main Reviewer placeholder in checklist
RayStick 3962c43
Update reviewer placeholder in checklist template
RayStick 3c497b3
end loop
RayStick a6e41f1
make sure it includes @ in the comment
RayStick 0132137
Refactor checklist template determination logic
RayStick 9a49ce0
Update pull request event types in workflow
RayStick ccdba22
Refactor reviewer checklist workflow for pull requests
RayStick 8b0a33f
Update .github/workflows/main-reviewer.yml
RayStick c0ae6a6
Update .github/workflows/main-reviewer.yml
RayStick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,51 @@ | ||
| name: Main Reviewer Checklist | ||
| name: Reviewer Checklist | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [assigned] | ||
| types: [review_requested] | ||
|
|
||
| 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 | ||
| - name: Extract PR reviewer info | ||
| id: pr_details | ||
| run: | | ||
| echo "ASSIGNEE=$(jq -r '.assignee.login' < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
| REVIEWERS=$(jq -r '.pull_request.requested_reviewers[].login' < $GITHUB_EVENT_PATH) | ||
| NEW_REVIEWER=$(jq -r '.requested_reviewer.login' < $GITHUB_EVENT_PATH) | ||
| ACTOR=$(jq -r '.sender.login' < $GITHUB_EVENT_PATH) | ||
| echo "REVIEWERS=$REVIEWERS" >> $GITHUB_ENV | ||
| echo "NEW_REVIEWER=$NEW_REVIEWER" >> $GITHUB_ENV | ||
| echo "ACTOR=$ACTOR" >> $GITHUB_ENV | ||
| - name: Determine checklist type | ||
| id: checklist_type | ||
| run: | | ||
| # Only act if the user requested themselves | ||
| if [ "$ACTOR" != "$NEW_REVIEWER" ]; then | ||
| echo "SKIP=true" >> $GITHUB_ENV | ||
| exit 0 | ||
| fi | ||
| COUNT=$(echo "$REVIEWERS" | wc -w) | ||
RayStick marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [ "$COUNT" -eq "1" ]; then | ||
| echo "TEMPLATE=main_rev_checklist.md" >> $GITHUB_ENV | ||
| echo "SKIP=false" >> $GITHUB_ENV | ||
| else | ||
| echo "TEMPLATE=rev_checklist.md" >> $GITHUB_ENV | ||
| echo "SKIP=false" >> $GITHUB_ENV | ||
| fi | ||
| # Step 3: Replace the placeholder in the checklist template | ||
| - name: Replace reviewer name in checklist template | ||
| - name: Prepare checklist | ||
| if: env.SKIP == 'false' | ||
| run: | | ||
| ASSIGNEE=${{ env.ASSIGNEE }} | ||
| sed "s/__MAINREV__/$ASSIGNEE/g" .github/workflows/main_rev_checklist.md > filled_checklist.md | ||
| sed "s/__REV__/${{ env.NEW_REVIEWER }}/g" .github/workflows/${{ env.TEMPLATE }} > filled_checklist.md | ||
| # Step 4: Post the filled checklist as a comment | ||
| - name: Post checklist as a comment | ||
| if: env.SKIP == 'false' | ||
| 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 | ||
RayStick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| Hello @__REV__! | ||
|
|
||
| You've been assigned to this PR, which means that you've been nominated as reviewer! You are a supporting reviewer, not the main reviewer - the main reviewer has more responsibilities than you (lucky them) but your review is still important. | ||
|
|
||
| If you have any doubt, check [this section on reviewing](https://phys2bids.readthedocs.io/en/latest/contributorfile.html#reviewing) | ||
|
|
||
| Checklist | ||
| - [ ] one | ||
| - [ ] two | ||
| - [ ] three | ||
|
|
||
| Thank you! |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.