ci: prevent slack notification failures on forked PRs#1058
Merged
openminddev merged 3 commits intoOpenMind:mainfrom Jan 27, 2026
Merged
ci: prevent slack notification failures on forked PRs#1058openminddev merged 3 commits intoOpenMind:mainfrom
openminddev merged 3 commits intoOpenMind:mainfrom
Conversation
Contributor
|
@MuhamadRifansyah |
89e9951 to
7c59aad
Compare
Contributor
Author
|
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.
Contributor
|
Hi @MuhamadRifansyah I rewrote the PR for you. You can directly check whether the head is the forked repo or not. |
Contributor
Author
Thanks a lot for the help and rewrite 🙏 |
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.
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_URLto a global environment variableSLACK_WEBHOOK_URLso it can be safely referenced inif:conditionals.Conditional Execution
Updated Slack notification steps to run only when
env.SLACK_WEBHOOK_URLis not empty.Error Handling
Added
continue-on-error: trueto 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
secretscontext in allconditional execution paths. Mapping secrets to environment variables
is the recommended and most robust pattern for conditional checks.