Skip to content

ci: prevent slack notification failures on forked PRs#1058

Merged
openminddev merged 3 commits intoOpenMind:mainfrom
MuhamadRifansyah:ci/slack-notification-guard
Jan 27, 2026
Merged

ci: prevent slack notification failures on forked PRs#1058
openminddev merged 3 commits intoOpenMind:mainfrom
MuhamadRifansyah:ci/slack-notification-guard

Conversation

@MuhamadRifansyah
Copy link
Copy Markdown
Contributor

Overview

This PR improves the robustness of the CI pipeline for forked repositories.
Currently, the integration-tests.yml workflow fails on forks because the
ONCALL_SLACK_WEBHOOK_URL secret is missing, causing Slack notification steps
to error out even when tests pass.

This change ensures notification failures do NOT affect overall workflow status.

Changes

  • Environment Variable Mapping
    Mapped secrets.ONCALL_SLACK_WEBHOOK_URL to a global environment variable
    SLACK_WEBHOOK_URL so it can be safely referenced in if: conditionals.

  • Conditional Execution
    Updated Slack notification steps to run only when
    env.SLACK_WEBHOOK_URL is not empty.

  • Error Handling
    Added continue-on-error: true to Slack notification steps so failures
    (e.g. missing secret, network issues) do not fail the workflow.

Testing

  • Fork Behavior
    Verified that workflows triggered from forks skip Slack notifications
    gracefully without failing the job.

  • Upstream Behavior
    Confirmed scheduled workflows in the main repository still send Slack
    notifications as before.

  • Syntax Validation
    Verified GitHub Actions YAML syntax and conditional logic compatibility.

Impact

  • Contributors
    Eliminates false-negative CI failures for forked PRs.

  • Maintainers
    Preserves on-call Slack alerting without introducing CI noise.

Additional Information

GitHub Actions does not reliably expose the secrets context in all
conditional execution paths. Mapping secrets to environment variables
is the recommended and most robust pattern for conditional checks.

@MuhamadRifansyah MuhamadRifansyah requested a review from a team as a code owner January 7, 2026 11:40
@github-actions github-actions Bot added ci-cd CI/CD changes config Configuration files labels Jan 7, 2026
@Wanbogang
Copy link
Copy Markdown
Contributor

@MuhamadRifansyah
please resolve conflicts

@MuhamadRifansyah MuhamadRifansyah force-pushed the ci/slack-notification-guard branch from 89e9951 to 7c59aad Compare January 27, 2026 05:18
@MuhamadRifansyah
Copy link
Copy Markdown
Contributor Author

@MuhamadRifansyah please resolve conflicts
Thanks for the heads up sir
I’ve rebased the branch onto the latest upstream/main and resolved the conflict in .github/workflows/integration-tests.yml.

Wanbogang and others added 2 commits January 27, 2026 12:42
Removes SLACK_WEBHOOK_URL from environment and updates Slack notification steps to check for non-forked pull requests instead of environment variable. This streamlines the workflow and ensures notifications are only sent for scheduled events from the main repository.
@openminddev
Copy link
Copy Markdown
Contributor

openminddev commented Jan 27, 2026

Hi @MuhamadRifansyah I rewrote the PR for you. You can directly check whether the head is the forked repo or not.

@openminddev openminddev merged commit 19226fd into OpenMind:main Jan 27, 2026
1 check passed
@MuhamadRifansyah
Copy link
Copy Markdown
Contributor Author

Hi @MuhamadRifansyah I rewrote the PR for you. You can directly check whether the head is the forked repo or not.

Thanks a lot for the help and rewrite 🙏
Really appreciate the quick merge and guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI/CD changes config Configuration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants