Skip to content
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 CodeQL pipeline failure #2032

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Fix CodeQL pipeline failure #2032

merged 1 commit into from
Feb 15, 2024

Conversation

helsaawy
Copy link
Contributor

CodeQL Analyze job fails with:Resource not accessible by integration, and logs show the following help:

This run of the CodeQL Action does not have permission to access Code Scanning API endpoints.
As a result, it will not be opted into any experimental features. This could be because the Action is running on a pull request from a fork. If not, please ensure the Action has the 'security-events: write' permission. Details: Resource not accessible by integration

Add security-events: write, along with default contents and packages read permissions.

CodeQL Analyze job fails with:`Resource not accessible by integration`,
and logs show the following help:

This run of the CodeQL Action does not have permission to access Code
Scanning API endpoints.
As a result, it will not be opted into any experimental features.
This could be because the Action is running on a pull request from a fork.
If not, please ensure the Action has the 'security-events: write' permission.
Details: Resource not accessible by integration

Add `security-events: write`, along with default `contents` and
`packages` read permissions.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
@helsaawy helsaawy requested a review from a team as a code owner February 15, 2024 20:16
@@ -31,6 +31,11 @@ on:
env:
GO_VERSION: "1.19.x"

permissions:
contents: read
packages: read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is adding these needed? is it ok to leave them as default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so; documentation says if they aren't specified, then they will be set to non, so might as be safe

If you specify the access for any of these scopes, all of those that are not specified are set to none.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

@helsaawy helsaawy merged commit 5f9910a into microsoft:main Feb 15, 2024
18 of 19 checks passed
@helsaawy helsaawy deleted the codeql-perm branch February 15, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants