-
Notifications
You must be signed in to change notification settings - Fork 16
feat(ci): add slack workflow to notify PSA workflow status #313
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: main
Are you sure you want to change the base?
Conversation
pankajmouriyakong
commented
Sep 19, 2025
- Configure Slack notifications for all workflow status changes (failures, successes, etc.)
Luacheck Report1 files 1 suites 0s ⏱️ Results for commit a91f204. ♻️ This comment has been updated with latest results. |
| notify-slack: | ||
| name: Slack Notification | ||
| needs: [test-sca-dir] | ||
| # if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
| if: ${{ always() }} | ||
| uses: ./.github/workflows/workflow-notifications.yml | ||
| with: | ||
| workflow_name: "SCA Directory Scan Workflow" | ||
| job_status: ${{ contains(needs.*.result, 'failure') && 'failure' || contains(needs.*.result, 'success') && 'success' || 'failure' }} | ||
| secrets: | ||
| SLACK_WEBHOOK_URL_NOTIFY: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_PUBLIC_SHARED_ACTIONS }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To remedy the issue, add a permissions: block to the notify-slack job definition in .github/workflows/dir-scan.yml (starting at line 41).
- If the job never uses GITHUB_TOKEN, set the block to
permissions: {}(which disables the token). - If minimal read access is required, specify it directly (e.g.,
permissions: contents: read). - Since the CodeQL recommendation is to use the minimal starting point of
permissions: {}, and unless you have evidence that the job requires specific fine-tuned permissions, the best fix is to add the linepermissions: {}aftername: Slack Notification(line 42). - This change should be limited to inserting a single permissions block, without affecting the rest of the workflow functionality.
-
Copy modified line R43
| @@ -40,6 +40,7 @@ | ||
| ## TODO before merge: Run only on main and push event | ||
| notify-slack: | ||
| name: Slack Notification | ||
| permissions: {} | ||
| needs: [test-sca-dir] | ||
| # if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
| if: ${{ always() }} |
saisatishkarra
left a comment
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.
LGTM. please test it out
b9de876 to
f3e2495
Compare
b9a79c9 to
a91f204
Compare
|
@saisatishkarra Review required |