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(CI): Trigger CodeQL on everything except the "push" event for Dependabot branches #66

Merged
merged 4 commits into from
Jun 16, 2021

Conversation

ScottBrenner
Copy link
Owner

@ScottBrenner ScottBrenner commented Jun 12, 2021

Summary

The CodeQL workflow fails on the "push" event for Dependabot branches - https://github.com/ScottBrenner/cfn-lint-action/actions/workflows/codeql-analysis.yml with an error message like:

Error: Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading Code Scanning results requires write access. To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See https://docs.github.com/en/code-security/secure-coding/configuring-code-scanning#scanning-on-push for more information on how to configure these events.

(https://github.com/ScottBrenner/cfn-lint-action/runs/2764966785?check_suite_focus=true#step:3:55)

So, this pull request proposes ignoring the "push" event for Dependabot branches.

Additionally removing specific branches for trigger events, don't we want this to run everywhere?

Other Information

Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags

@ScottBrenner ScottBrenner added bug Something isn't working enhancement New feature or request labels Jun 12, 2021
@ScottBrenner ScottBrenner changed the title fix(CodeQL): Avoid triggering on the "push" event for Dependabot branches fix(CodeQL): Trigger on everything except the "push" event for Dependabot branches Jun 12, 2021
@@ -2,9 +2,8 @@ name: "CodeQL"

on:
push:
branches: [ main, v* ]
branches-ignore: dependabot/**
Copy link
Owner Author

Choose a reason for hiding this comment

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

Admittedly not sure if this would resolve the errors as it appears to be failing on push events to main - https://github.com/ScottBrenner/cfn-lint-action/actions/workflows/codeql-analysis.yml?query=event%3Apush

However https://github.com/ScottBrenner/cfn-lint-action/runs/2764966785?check_suite_focus=true#step:3:55 does say avoid triggering on the "push" event for Dependabot branches

@@ -2,9 +2,8 @@ name: "CodeQL"

on:
push:
branches: [ main, v* ]
branches-ignore: dependabot/**
pull_request:
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
pull_request:

This could be removed as push would now trigger for all branches

@ScottBrenner ScottBrenner changed the title fix(CodeQL): Trigger on everything except the "push" event for Dependabot branches fix(CI): Trigger CodeQL on everything except the "push" event for Dependabot branches Jun 13, 2021
NickLiffen
NickLiffen previously approved these changes Jun 14, 2021
@ScottBrenner
Copy link
Owner Author

@ScottBrenner ScottBrenner merged commit 6b6dfaf into main Jun 16, 2021
@ScottBrenner ScottBrenner deleted the ScottBrenner-patch-1 branch June 16, 2021 15:32
@NickLiffen
Copy link
Collaborator

@ScottBrenner sorry for not approving this 🤦 I meant to 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants