-
Notifications
You must be signed in to change notification settings - Fork 19
chore(CI): add slack notifications #498
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
Merged
+39
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1b20e73
m
rishav-karanjit 9edeab4
m
rishav-karanjit 11d643e
Potential fix for code scanning alert no. 8: Workflow does not contai…
rishav-karanjit f75c945
Potential fix for code scanning alert no. 6: Workflow does not contai…
rishav-karanjit 3627636
Add id-token permission to CI workflow
rishav-karanjit 4cbbf36
Merge branch 'main' into rishav/slack-notification
rishav-karanjit e0555e7
Merge branch 'main' into rishav/slack-notification
rishav-karanjit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Issue Created Notification | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| issues: | ||
| types: [opened, reopened] | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| notify-issue: | ||
| if: github.event_name == 'issues' | ||
| uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main | ||
| with: | ||
| message: "New github issue `${{ github.event.issue.title }}`. Link: ${{ github.event.issue.html_url }}" | ||
| secrets: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GHI }} | ||
|
|
||
| notify-comment: | ||
|
||
| if: github.event_name == 'issue_comment' && !github.event.issue.pull_request | ||
| uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main | ||
| with: | ||
| message: "New comment on issue `${{ github.event.issue.title }}`. Link: ${{ github.event.comment.html_url }}" | ||
| secrets: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GHI }} | ||
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
In general, the fix is to add an explicit
permissions:block limiting theGITHUB_TOKENto the minimum required scopes, either at the workflow root (applies to all jobs) and/or per job when some jobs need elevated access. Since we cannot see the internals of the reusable workflows being called, the safest non‑breaking change is to define a conservative but commonly sufficient set of permissions. A typical minimal baseline for CI jobs that only need to read the repo and update checks iscontents: readand, if required by reusable workflows,statuses: write. Because we can’t infer that write access is definitely unnecessary, we should at least setcontents: readat the workflow level; further, many reusable workflows that report status or annotations rely onchecksorstatuses. To avoid breaking existing behavior while still being explicit, we can add a workflow‑levelpermissions:block withcontents: readand leave other scopes at their implicit default ofnone.Concretely, edit
.github/workflows/ci-workflow.ymlnear the top of the file, after thename:and beforeon:(lines 1–3), to insert apermissions:section. This will apply to all jobs (Static_Analysis,Build,Examples,notify) because none of them define their ownpermissions. No imports or additional methods are needed; this is purely a YAML configuration change.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 does see permissions in workflow