Skip to content

chore(CI): add slack notifications#498

Merged
rishav-karanjit merged 7 commits intomainfrom
rishav/slack-notification
Apr 6, 2026
Merged

chore(CI): add slack notifications#498
rishav-karanjit merged 7 commits intomainfrom
rishav/slack-notification

Conversation

@rishav-karanjit
Copy link
Copy Markdown
Member

Issue #, if available:

Description of changes:

Adding slacking notification on daily CI failure and issue creation.

Similar PR in DB-ESDK: aws/aws-database-encryption-sdk-dynamodb#1964

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

Comment on lines +34 to +45
needs:
[
Static_Analysis,
Build,
Examples,
]
if: ${{ failure() && github.event_name == 'schedule' }}
uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main
with:
message: "Daily CI failed on `${{ github.repository }}`. View run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CI }}

Check warning

Code 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 Autofix

AI 3 months ago

In general, the fix is to add an explicit permissions: block limiting the GITHUB_TOKEN to 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 is contents: read and, if required by reusable workflows, statuses: write. Because we can’t infer that write access is definitely unnecessary, we should at least set contents: read at the workflow level; further, many reusable workflows that report status or annotations rely on checks or statuses. To avoid breaking existing behavior while still being explicit, we can add a workflow‑level permissions: block with contents: read and leave other scopes at their implicit default of none.

Concretely, edit .github/workflows/ci-workflow.yml near the top of the file, after the name: and before on: (lines 1–3), to insert a permissions: section. This will apply to all jobs (Static_Analysis, Build, Examples, notify) because none of them define their own permissions. No imports or additional methods are needed; this is purely a YAML configuration change.

Suggested changeset 1
.github/workflows/ci-workflow.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml
--- a/.github/workflows/ci-workflow.yml
+++ b/.github/workflows/ci-workflow.yml
@@ -1,5 +1,8 @@
 name: Continuous Integration Workflow
 
+permissions:
+  contents: read
+
 on:
   pull_request:
   push:
EOF
@@ -1,5 +1,8 @@
name: Continuous Integration Workflow

permissions:
contents: read

on:
pull_request:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@rishav-karanjit rishav-karanjit committed this autofix suggestion 3 months ago.
Copy link
Copy Markdown
Member Author

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

rishav-karanjit and others added 5 commits January 9, 2026 09:48
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rishav-karanjit rishav-karanjit marked this pull request as ready for review April 6, 2026 18:11
@rishav-karanjit rishav-karanjit requested a review from a team as a code owner April 6, 2026 18:11
@rishav-karanjit rishav-karanjit merged commit 4986950 into main Apr 6, 2026
21 checks passed
@rishav-karanjit rishav-karanjit deleted the rishav/slack-notification branch April 6, 2026 21:07
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