Skip to content

ci: publish on bundled-data changes + workflow_dispatch trigger#95

Open
bk86a wants to merge 2 commits into
mainfrom
chore/ci-publish-paths-and-dispatch
Open

ci: publish on bundled-data changes + workflow_dispatch trigger#95
bk86a wants to merge 2 commits into
mainfrom
chore/ci-publish-paths-and-dispatch

Conversation

@bk86a
Copy link
Copy Markdown
Owner

@bk86a bk86a commented May 28, 2026

Summary

Fixes a CI-paths-filter bug that caused PR #93 to merge without triggering a fresh container publish. Two files that the Dockerfile COPYs into the image were missing from the changes filter:

  • tercet_missing_codes.csv — the bundled estimates fallback table
  • docker-entrypoint.sh — the actual container ENTRYPOINT

A CSV-only or entrypoint-only change should rebuild the image, because both files affect what ships in ghcr.io/.../:latest. Adds them to the filter.

Also adds workflow_dispatch to the workflow triggers and to the publish job's if condition, so future manual rebuilds don't require an empty-commit dance.

Consequence on merge

Triggers a fresh image build that includes #93's CSV update (38 new postcodes + the LT 71205 → LT024 correction). After this merges, :latest will carry both the v0.19.3 deps and the latest data.

Test plan

  • CI green on this PR
  • After merge: gh run list --workflow ci.yml --branch main --limit 1 shows the publish job ran (not skipped)
  • ghcr.io/bk86a/PostalCode2NUTS:latest points at the new SHA

🤖 Generated with Claude Code

…dispatch

The publish job uses a path filter to skip on docs-only changes, but the
filter was excluding two files that ARE bundled into the container image
via the Dockerfile:

- tercet_missing_codes.csv (estimates fallback table)
- docker-entrypoint.sh (the actual ENTRYPOINT)

Consequence: PR #93 (CSV-only data update) was merged but `publish`
skipped, so `ghcr.io/.../:latest` still pointed at the previous image
without the 38 new postcodes and the LT 71205 fix. Same risk applies to
any future entrypoint-only change.

Adds both files to the `code:` filter so a fresh image is published on
merge. Also adds `workflow_dispatch` so the publish flow can be
re-triggered manually from the Actions UI (or `gh workflow run`) without
needing an empty commit dance; updates the `publish` job's `if` to allow
that event type as well.

Side effect of this PR landing: triggers a fresh image build that picks
up #93's CSV update, so the next redeploy from `:latest` will ship both
the v0.19.3 deps and the data update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bk86a bk86a force-pushed the chore/ci-publish-paths-and-dispatch branch from 87966ef to 2f55251 Compare May 28, 2026 09:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f552516fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated

publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.code == 'true'
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && needs.changes.outputs.code == 'true'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Let manual dispatch bypass the change filter

For workflow_dispatch runs on main, dorny/paths-filter still computes needs.changes.outputs.code from the selected ref's last commit, so a manual rebuild after a docs-only last commit (or any rebuild that is needed without a new code diff) will skip publish because this condition remains false. That keeps the newly added manual trigger from replacing the empty-commit workaround in those cases; consider making workflow_dispatch publish independent of the path-filter result or forcing the filter output true for manual runs.

Useful? React with 👍 / 👎.

Codex flagged on #95: dorny/paths-filter still evaluates against the
selected ref's last commit for workflow_dispatch runs, so a manual
rebuild after a docs-only last commit would skip publish — defeating
the point of adding the manual trigger as a replacement for the empty-
commit dance.

Split the condition: workflow_dispatch on main always publishes; push
to main still publishes only when a code-relevant file changed. The
push branch keeps the noise-reduction filter we already wanted; the
manual branch trusts the operator to know they want a rebuild.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bk86a
Copy link
Copy Markdown
Owner Author

bk86a commented May 28, 2026

Good catch — fixed in 82a5583.

The bot is right: dorny/paths-filter@v4 still computes needs.changes.outputs.code against the selected ref's last commit on workflow_dispatch, so a manual rebuild after a docs-only last commit would have skipped publish, defeating the point of adding the manual trigger.

Split the condition so:

  • workflow_dispatch on main → always publishes (operator explicitly asked for it)
  • push to main → publishes only if a code-relevant file changed (noise-reduction filter preserved)

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.

1 participant