chore(CI): add slack notifications by rishav-karanjit · Pull Request #784 · aws/aws-encryption-sdk-python
In general, this issue is fixed by explicitly defining a permissions: block for the workflow or individual jobs, restricting the GITHUB_TOKEN to the minimal scopes needed. For an issue/comment notification workflow that only reads event payloads and sends a Slack message via a secret, no write permissions are needed; read-only access is sufficient, and often only contents: read (and optionally issues: read) is required.
The best fix here without changing functionality is to add a top-level permissions: block (applies to all jobs) near the top of .github/workflows/issue-notification.yml, underneath name: (or on:). Since the jobs simply consume github.event.issue and github.event.comment fields and delegate to a reusable Slack notification workflow, they do not perform any write operations on the repository. A safe and minimal configuration is:
permissions: contents: read issues: read
If the reusable workflow needs no GitHub API access, even issues: read may be unnecessary, but including it is harmless and explicit. No imports, methods, or additional definitions are needed; this is purely a YAML configuration change inside .github/workflows/issue-notification.yml.