-
Notifications
You must be signed in to change notification settings - Fork 799
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
[Release Automation] Label PRs with GitHub Action #3151
[Release Automation] Label PRs with GitHub Action #3151
Conversation
Github action failed to label the PR due to resource not accessible by integration. Is there any permission required to access the files? |
Build Failed 😱 Build Id: 6bc8522d-0bdd-48cd-8303-ac00805cfa39 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 4924d90f-1c38-4a7c-9438-b4b6e22ddcfc To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
7542f99
to
0f04029
Compare
Build Succeeded 👏 Build Id: 14d0d643-9eb7-42c5-9f09-74eae847d2a5 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: b0c95a53-29df-4552-9873-24ea8918aecc The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Failed 😱 Build Id: 04e77449-b426-4f01-b133-6c4d122ddf74 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
uses: actions/github-script@v4 | ||
with: | ||
async: yes | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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.
What happens if you use the AGONES_BOT
secret?
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.
I attempted to use AGONES_BOT by creating a secret with that name in my repo and it is functioning as intended - https://github.com/Kalaiselvi84/agones/actions/runs/5133792952/jobs/9236886161?pr=262
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.
Let's take that for a spin, see how it goes.
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.
I created a new PR to test this script, but it did not receive any labels. Instead, I encountered an error message stating, "Error retrieving files: HttpError: Resource not accessible by integration." - https://github.com/googleforgames/agones/actions/runs/5140174858/jobs/9251379449?pr=3194
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.
That's weird. So it worked once but not a second time?
Should we just merge it and see what happens on the Agones repo? Any downside?
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.
It is working fine in my fork every time but fails in Agones.
My fork - https://github.com/Kalaiselvi84/agones/actions/runs/5133792952/jobs/9236886161?pr=262
Agones repo - https://github.com/googleforgames/agones/actions/runs/5140174858/jobs/9251379449?pr=3194
Should we just merge it and see what happens on the Agones repo? Any downside?
I am unsure about the Github Action script's functionality, given our prior experience with the "update branch" task. While it worked smoothly in our fork, it encountered issues when applied to Agones.
Do we need to configure permissions for AGONES_BOT in order to resolve the error encountered in the Agones repository: 'Error retrieving files: HttpError: Resource not accessible by integration'?
Build Failed 😱 Build Id: 20ec9c47-7435-4891-8885-7437dd54dab9 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 6ff4f47e-4461-4ab3-8558-c8dbe2cb2592 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 9c718437-d6cf-4e52-a8ce-baf799ce33f3 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
.github/workflows/label-pr.yml
Outdated
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout code |
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.
Curious - do we need to check out the repository code?
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.
This line is not required. I included it to ensure that the workflow can access the files to avoid the integration issue, but still the error persists so will remove it
with: | ||
async: yes | ||
repo-token: ${{ secrets.AGONES_BOT }} | ||
script: | |
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.
It's super cool you can do this.
Build Failed 😱 Build Id: 8039a281-dd7f-4fb9-9497-cf10ff8f61d1 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
.github/workflows/label-pr.yml
Outdated
permissions: | ||
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.
permissions: | |
pull-requests: write | |
permissions: | |
contents: read | |
pull-requests: write |
Possibly? Just taking reference from: https://github.com/actions/labeler#create-workflow
It's also possible to try it with the GITHUB_TOKEN
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.
Or try permissions: read-all|write-all
as mentioned in https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions, just to see if it's a permissions issue.
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.
@markmandel, please merge this PR. I was able to reproduce the error in my fork by not adding the write permission to the pull_request and issues - https://github.com/Kalaiselvi84/agones/actions/runs/5185413754/jobs/9345294118?pr=274
You can adjust the permission in Agones if there is any issues. WDYT?
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.
Sounds good! Merging!
Build Failed 😱 Build Id: 741a8bf2-06b7-4aad-85ab-6c2ef0d6e7cc To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: f3da7a13-d54d-4264-9d05-fd502aff2d26 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Kalaiselvi84, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Which issue(s) this PR fixes:
Closes #2459
Special notes for your reviewer: