Skip to content

ci: add workflow_dispatch escape hatch to sync-plugin-version.yml#12

Merged
intel352 merged 2 commits into
mainfrom
ci/sync-workflow-dispatch
May 17, 2026
Merged

ci: add workflow_dispatch escape hatch to sync-plugin-version.yml#12
intel352 merged 2 commits into
mainfrom
ci/sync-workflow-dispatch

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

Defensive fix for workflow-plugin-aws#18: sync-plugin-version.yml silently no-op'd on a v1.2.0 tag push despite the matching tags: ['v*'] trigger that worked on v1.1.0. Root cause not identified (likely transient GitHub Actions backend hiccup); workaround was a manual one-line plugin.json sync PR.

This patch adds a workflow_dispatch trigger taking a tag input so the sync workflow can be manually re-fired when the push-tag trigger silently fails. Same patch applied across all 4 IaC plugin repos (aws/gcp/azure/digitalocean) since they share the workflow file pattern.

Changes

  • Add workflow_dispatch with inputs.tag (required string)
  • Tag source: ${{ inputs.tag || github.ref_name }} — manual dispatch uses input, push-tag uses ref_name

Test plan

  • YAML lint clean (no actionlint errors)
  • Manual workflow_dispatch with tag: v0.0.0 smoke-test to verify the workflow runs end-to-end (skipped — no test tag available; will exercise on the next real release)

Rollback

Revert this commit. Defensive change only; push-tag path unchanged.

Defensive fix for the failure mode surfaced by workflow-plugin-aws#18:
sync-plugin-version.yml did not fire on a v1.2.0 tag push despite the
matching `tags: ['v*']` trigger that worked on v1.1.0. Root cause was
not identified (likely transient GitHub Actions backend hiccup); the
workaround was a manual one-line plugin.json sync PR.

This change adds a workflow_dispatch trigger taking a tag input so the
sync workflow can be manually re-fired when the push-tag trigger
silently no-ops. The same patch is being applied across all 4 IaC
plugin repos (aws/gcp/azure/digitalocean) since they share the workflow
file pattern.

The push-tag trigger path is unchanged; the manual dispatch path uses
`inputs.tag` and falls back to `github.ref_name` otherwise via the
`inputs.tag || github.ref_name` expression.

Closes workflow-plugin-aws#18 (defensive fix; no root cause identified).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a manual fallback trigger for syncing plugin.json when the tag-push GitHub Actions trigger does not run as expected.

Changes:

  • Adds workflow_dispatch with a required tag input.
  • Updates version computation to use the manual input when present, otherwise the pushed tag ref.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

id: ver
run: |
TAG="${GITHUB_REF_NAME}"
TAG="${{ inputs.tag || github.ref_name }}"
Addresses Copilot findings on the workflow_dispatch escape-hatch PR:
- Add explicit tag regex validation (^vN.N.N(-suffix)?$) before any
  shell/Python interpolation — addresses 3 shell-injection inlines
  raised by Copilot across the 4 plugin PRs (gcp #12 line 26, DO #122
  lines 29 + 43, aws #19 line 26).
- DO only: restore the downloads[*].url update block that the prior
  push clobbered. DO has a regression-gate test
  TestSyncPluginVersionWorkflowUpdatesDownloads asserting the python
  block updates dl['url'] per release tag.
- aws/gcp/azure: NOT adding downloads-update because their goreleaser
  binary naming convention differs (`{name}_{version}_{goos}_{goarch}`
  vs DO's `{name}-{goos}-{goarch}`) — would create broken URLs. The
  downloads[] staleness is cosmetic; workflow-registry has authoritative
  download URLs.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

.github/workflows/sync-plugin-version.yml:33

  • This repeats the direct expression interpolation into a shell assignment. Even with the validation step above, an input can inject shell syntax while leaving TAG set to a valid-looking value, so this step can also execute unintended commands. Use a safely populated environment variable or the validated step output instead of embedding the raw input/ref expression in the script body.
          TAG="${{ inputs.tag || github.ref_name }}"

token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate tag format
run: |
TAG="${{ inputs.tag || github.ref_name }}"
@intel352
Copy link
Copy Markdown
Contributor Author

r2 review acknowledgement

Same finding + same response as aws PR #19. Validation step runs FIRST (regex rejects shell metacharacters); Compute step's interpolation is gated. Defensible pattern.

CI green; admin-merging.

@intel352 intel352 merged commit eee449e into main May 17, 2026
9 checks passed
@intel352 intel352 deleted the ci/sync-workflow-dispatch branch May 17, 2026 05:27
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.

2 participants