-
Notifications
You must be signed in to change notification settings - Fork 82
fix: update permissions for welcome workflow to avoid 403 error #181
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
fix: update permissions for welcome workflow to avoid 403 error #181
Conversation
Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
Pull Request Test Coverage Report for Build 19715244518Details
💛 - Coveralls |
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aniketpati1121!
I think @kramaranya originally tried to use PR target, but it doesn't work: #82
Did we miss the contents: write permission?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aniketpati1121! I think @kramaranya originally tried to use PR target, but it doesn't work: #82
Did we miss the
contents: writepermission?
Thanks @andreyvelich! Yes, we added contents: write permission and updated the workflow to use pull_request_target, so it should now successfully post comments on new PRs and issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to remove the permission at the Workflow level (e.g. L11-L13)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are only using job-level permissions under welcome job, so no workflow-level permissions are set. This should be sufficient for the action to post comments successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, can you remove these lines in your PR:
sdk/.github/workflows/welcome-new-contributors.yaml
Lines 11 to 14 in 8672d5f
| permissions: | |
| issues: write | |
| pull-requests: write | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that might work. I'm thinking whether we should just add contents: write at the workflow level instead and keep other permissions there as well? Similar to https://github.com/HugoBlox/hugo-blox-builder/blob/0ef515fbaeeda95259fa77e817b4538e84bf6a9e/.github/workflows/community-welcome.yml#L12-L15 and https://github.com/actions/first-interaction/blob/main/README.md?plain=1#L39-L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if anything else is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aniketpati1121 Can you move contents: write to the workflow level permission (e.g. L40)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aniketpati1121 Can you move
contents: writeto the workflow level permission (e.g. L40)?
Updated the workflow by moving contents: write to the workflow-level permissions
Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
|
Thanks @aniketpati1121! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…flow#181) * fix: update permissions for welcome workflow to avoid 403 errors Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: remove unnecessary permissions, keep only contents: write Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: move contents: write to workflow-level permissions Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: replace pull_request with pull_request_target Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> --------- Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
…flow#181) * fix: update permissions for welcome workflow to avoid 403 errors Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: remove unnecessary permissions, keep only contents: write Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: move contents: write to workflow-level permissions Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> * fix: replace pull_request with pull_request_target Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com> --------- Signed-off-by: Aniket Patil <aniketpatil2027@gmail.com>
This PR fixes the 403 "Resource not accessible by integration" error
in the "Welcome new contributors" workflow.
Changes:
contentspermission fromreadtowritepull_requestsandissueshave proper write accessThis allows the
actions/first-interactionaction to successfully postwelcome comments on new issues and PRs.
fixes #179