-
Type: Sub-task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
See parent NODE-5348
Implementation notes from Kickoff:
- We will make the following changes directly to release_notes.yml, it can resolve the difference between a comment trigger and a workflow_dispatch trigger for sourcing the releasePR number.
- release_notes adds the following trigger: `on: { issue_comment: { types: [created] }}`
- When a comment triggers the workflow
- Use ${{ github.event.comment.body == 'run release_notes' }} to check for the correct trigger string
- Use ${{ github.event.issue.number }} to get the release PR's number
- Use ${{ github.triggering_actor }} to get the current user ENSURE not empty string
- Use gh api \ "/repos/${{ github.repository_owner }}/${{ github.repository }}/collaborators?permission=admin" --paginate --jq ".[].login" \ | grep -q "$triggering_actor" to get the list of admins
- Using the gh CLI, we can hit the API endpoint for our repo, listing collaborators with the permission "admin"
- The paginate flag will fetch until we've gotten all results
- Use the jq flag to get just the username out of the JSON
- grep will exit 1 or 0 for finding a match or not
- Check the exit code with bash if/else
- When workflow dispatch triggers the workflow
- Use ternaries and if conditions on steps as needed to reuse the same workflow
- Skip admin checking, and ensure the releasePr is set correctly before running the action