-
Notifications
You must be signed in to change notification settings - Fork 84
chore(CI): add slack notifications #784
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||
| name: Issue Created Notification | ||||||||||||||||||||||||||||||||
| 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: | ||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+17
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 1 day ago In general, the fix is to explicitly declare a The best fix without changing existing functionality is to add a top-level
Suggested changeset
1
.github/workflows/issue-notification.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
| 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 }} | ||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+23
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 1 day ago In general, this issue is fixed by explicitly defining a The best fix here without changing functionality is to add a top-level permissions:
contents: read
issues: readIf the reusable workflow needs no GitHub API access, even
Suggested changeset
1
.github/workflows/issue-notification.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 1 day ago
In general, the fix is to add an explicit
permissionsblock to the workflow (at the root level, or per job) to restrict theGITHUB_TOKENto the minimal access necessary. Root-levelpermissionsact as defaults for all jobs that do not override them, which is appropriate here since none of the shown jobs declare their own permissions.The safest change without altering existing functionality is to add a root-level
permissionsblock just after thename: Daily CIline, settingcontents: read. This is the minimal common permission needed for typical CI workflows (e.g., to fetch the repo). If any of the called reusable workflows require additional scopes (such aspull-requests: writefor status updates), they should define those themselves; addingcontents: readat the root will not block that. Thenotifyjob appears to send a Slack message using a secret and should not need elevatedGITHUB_TOKENscopes, so the root-levelcontents: readis appropriate.Concretely, in
.github/workflows/daily_ci.yml, insert:between lines 2 and 4. No imports or additional definitions are required, as this is purely YAML configuration within GitHub Actions.