Skip to content

Add Slack notification workflow for PR events - #200

Merged
OS-alexandretome merged 1 commit into
b11from
R11DT-3590AddSlackNotificationToB11
Jan 28, 2026
Merged

OS-alexandretome merged 1 commit into
b11from
R11DT-3590AddSlackNotificationToB11

Conversation

@OS-miguelfreitas

@OS-miguelfreitas OS-miguelfreitas commented Jan 27, 2026 •

Copy link
Copy Markdown

Introduces a GitHub Actions workflow to send Slack notifications when a pull request is opened or marked ready for review by specific users. The workflow uses a Slack webhook and includes PR details in the notification payload.

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

Introduces a GitHub Actions workflow to send Slack notifications when a pull request is opened or marked ready for review by specific users. The workflow uses a Slack webhook and includes PR details in the notification payload.
@OS-miguelfreitas OS-miguelfreitas self-assigned this Jan 27, 2026
@wiz-code-outsystems

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 1 Low 1 Info
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 Low 1 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Pull Request Developer Guidance

Questions? See the Wiz FAQ.

Please contact the Security Office if you encounter issues with Wiz PR scanning.

@OS-miguelfreitas
OS-miguelfreitas marked this pull request as ready for review January 27, 2026 17:00
@OS-miguelfreitas
OS-miguelfreitas requested a review from a team as a code owner January 27, 2026 17:00
Comment on lines +10 to +22
if: ${{ contains(fromJSON('["OS-miguelfreitas", "OS-joaomurgeiro", "osjlopes", "mvios", "OS-alexandretome", "rmb-guerra", "OS-rodrigolopes", "OS-thiagosiqueira", "OS-luisvendrame", "OS-josecunha"]'), github.event.pull_request.user.login) && !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
pr_url: "${{ github.event.pull_request.html_url }}"
pr_number : "${{ github.event.pull_request.number }}"
pr_title: "${{ github.event.pull_request.title }}"
pr_user: "${{ github.event.pull_request.user.login }}"
pr_reviewers : "${{ join( github.event.pull_request.requested_reviewers.*.login , ' , ' ) }}"

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 9 months ago

In general, the fix is to explicitly set a restrictive permissions: block either at the workflow root or within the job so that GITHUB_TOKEN has only the minimal needed permissions. Since this workflow only reads pull request metadata (via github.event) and posts to Slack with a secret webhook, it does not need to use GITHUB_TOKEN at all. The safest configuration is to set permissions: {} at the workflow level (disabling all default permissions) or, if you prefer to keep minimal read access, use permissions: contents: read. Because the workflow doesn’t call the GitHub API via GITHUB_TOKEN, disabling all permissions is appropriate and does not change existing functionality.

Concretely, in .github/workflows/SlackNotification.yml, add a permissions: block near the top of the file, at the same indentation as on: and name:. This will apply to all jobs in the workflow, including slackNotification. No imports or additional methods are needed; this is purely a YAML configuration change. The best single change is:

name: Slack Notification

permissions: {}
on:
  pull_request_target:
  ...

This ensures that the GITHUB_TOKEN granted to the workflow has no repository permissions.

Suggested changeset 1
.github/workflows/SlackNotification.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/SlackNotification.yml b/.github/workflows/SlackNotification.yml
--- a/.github/workflows/SlackNotification.yml
+++ b/.github/workflows/SlackNotification.yml
@@ -1,5 +1,7 @@
 name: Slack Notification
 
+permissions: {}
+
 on: 
   pull_request_target:
     types:
EOF
@@ -1,5 +1,7 @@
name: Slack Notification

permissions: {}

on:
pull_request_target:
types:
Copilot is powered by AI and may make mistakes. Always verify output.
@OS-alexandretome
OS-alexandretome merged commit cfb3c9b into b11 Jan 28, 2026
10 of 11 checks passed
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.

4 participants