Skip to content

Fix CodeQL pipeline failure#2032

Merged
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:codeql-perm
Feb 15, 2024
Merged

Fix CodeQL pipeline failure#2032
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:codeql-perm

Conversation

@helsaawy
Copy link
Copy Markdown
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

permissions:
contents: read
packages: read
Copy link
Copy Markdown
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
Copy Markdown
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
@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