Skip to content

fix(ci): let the ministry list job open its pull request and notify on failure - #661

Merged
DerekRoberts merged 6 commits into
mainfrom
fix/scheduled-ministry-pr
Oct 9, 2026
Merged

DerekRoberts merged 6 commits into
mainfrom
fix/scheduled-ministry-pr

Conversation

@DerekRoberts

@DerekRoberts DerekRoberts commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The scheduled validate-ministry-list job has failed every day. It finds the ministry name change, then pushes to a fixed chore/ministry-name-schema branch. That branch already exists from 2024, so the push is rejected and no pull request is ever opened. Scheduled failures also notify no one.

Changes in scheduled.yml

  • Branch per run: each run uses chore/ministry-names-<run id>-<attempt>, so a leftover branch can't block it.
  • No duplicates: the job skips when a pull request with the same title is already open.
  • Bot identity: the commit sets user.name and user.email to github-actions[bot].
  • Assignee: DerekRoberts replaces the hardcoded mishraomp. CODEOWNERS still requests reviews from both owners.
  • Conventional title: fix(schema): update ministry names from gov.bc.ca.
  • Failure notice: a new notify job runs bcgov/actions/workflow-notifier v0.8.0 when any scheduled job fails. For a scheduled run it opens an issue assigned to the CODEOWNERS, or comments on the open one.

Not verified by CI

PR checks don't run this workflow. A manual run would also run the crawler and soft-delete jobs against prod, so the new pull-request step has not run yet.

Two more things to know:

  • A pull request opened with the workflow token doesn't trigger PR workflows, so its required checks won't report on their own. Closing and reopening it fixes that.
  • gh pr create needs "Allow GitHub Actions to create and approve pull requests". The repo's workflow permission API reports can_approve_pull_request_reviews: true, so this should work.

Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

…n failure

The job pushed to a fixed chore/ministry-name-schema branch, so once that branch existed every later run failed at the push and no pull request was opened. Each run now uses its own branch, skips when a ministry name pull request is already open, commits as github-actions[bot] and assigns DerekRoberts. A notify job opens or updates an issue through workflow-notifier when any scheduled job fails.
Copilot AI balanced review requested due to automatic review settings October 9, 2026 02:23
@DerekRoberts DerekRoberts self-assigned this Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Re-runs can reuse an existing branch, and generated PRs cannot trigger required checks.

2 open findings
What changed in this PR

Improves scheduled ministry-schema updates and adds failure notifications.

Changes:

  • Creates uniquely named branches and ministry update PRs.
  • Prevents duplicate open PRs.
  • Notifies CODEOWNERS when scheduled jobs fail.
File Description
.github/​workflows/​scheduled.yml Updates schema PR automation and adds failure notification.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/scheduled.yml Outdated
Comment thread .github/workflows/scheduled.yml
@DerekRoberts
DerekRoberts merged commit 18cf5d7 into main Oct 9, 2026
17 checks passed
@DerekRoberts
DerekRoberts deleted the fix/scheduled-ministry-pr branch October 9, 2026 19:07
@github-project-automation github-project-automation Bot moved this from Active to Done in DevOps (NR) Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants