Noticed this after I pulled the upstream main into my forked repo, but the notify_start, notify_success and notify_failure jobs are running and attempting to post to Slack, which fails the CI process:
We could probably prevent that job from running by checking to see if the SLACK_BOT_TOKEN is available, or in a similar way we check for the repository owner in the build matrix, using the github context:
jobs:
notify_start:
runs-on: ubuntu-latest
# Ideally this condition would be promoted to a workflow-level environment variable and shared
# but this doesn't seem to be supported yet https://github.community/t/how-to-set-and-access-a-workflow-variable/17335/6
if: github.repository_owner == 'AndcultureCode'
Noticed this after I pulled the upstream
main
into my forked repo, but thenotify_start
,notify_success
andnotify_failure
jobs are running and attempting to post to Slack, which fails the CI process:https://github.com/brandongregoryscott/AndcultureCode.Cli/runs/2082422702?check_suite_focus=true
We could probably prevent that job from running by checking to see if the
SLACK_BOT_TOKEN
is available, or in a similar way we check for the repository owner in the build matrix, using the github context:if: github.repository_owner == 'AndcultureCode'
The
build
job may need to be updated to always run with thealways()
function, despite depending onnotify_start
: see this comment for reference https://github.com/actions/runner/issues/491#issuecomment-716623031So the
build
job would look more like this...And the notify jobs would have this
if
: