feat(ci): add slack workflow to notify PSA workflow status#313
Open
pankajmouriyakong wants to merge 1 commit intomainfrom
Open
feat(ci): add slack workflow to notify PSA workflow status#313pankajmouriyakong wants to merge 1 commit intomainfrom
pankajmouriyakong wants to merge 1 commit intomainfrom
Conversation
Contributor
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. |
Comment on lines
+41
to
+51
| 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 6 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.
Suggested changeset
1
.github/workflows/dir-scan.yml
| @@ -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() }} |
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
saisatishkarra
previously approved these changes
Sep 19, 2025
Contributor
saisatishkarra
left a comment
There was a problem hiding this comment.
LGTM. please test it out
b9de876 to
f3e2495
Compare
b9a79c9 to
a91f204
Compare
Contributor
Author
|
@saisatishkarra Review required |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.