1
1
Fork
You've already forked zop
0

Add workflow_dispatch trigger to release workflow for manual re-runs #14

Merged
Copilot merged 3 commits from copilot/modify-release-workflow-manual-trigger into main 2026年03月17日 02:34:00 +01:00
Copilot commented 2026年03月16日 01:40:02 +01:00 (Migrated from github.com)
Copy link
  • Add workflow_dispatch trigger with a required tag input
  • Add resolve-tag job that validates the tag exists and outputs the effective tag
  • All jobs check out the resolved tag via ref:
  • Build ldflags version uses resolved tag
  • GitHub Release step uses tag_name and prerelease from resolved tag
  • Fix concurrency group: use github.ref_name (not github.ref) so push and dispatch paths produce the same format for the same tag
  • Fix shell injection: pass inputs.tag via env: and validate with a POSIX character allowlist before writing to $GITHUB_OUTPUT; use env: in validate step too

Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- [x] Add `workflow_dispatch` trigger with a required `tag` input - [x] Add `resolve-tag` job that validates the tag exists and outputs the effective tag - [x] All jobs check out the resolved tag via `ref:` - [x] Build ldflags version uses resolved tag - [x] GitHub Release step uses `tag_name` and `prerelease` from resolved tag - [x] Fix concurrency group: use `github.ref_name` (not `github.ref`) so push and dispatch paths produce the same format for the same tag - [x] Fix shell injection: pass `inputs.tag` via `env:` and validate with a POSIX character allowlist before writing to `$GITHUB_OUTPUT`; use `env:` in validate step too <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/peterwwillis/zop/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
peterwwillis (Migrated from github.com) reviewed 2026年03月16日 01:40:02 +01:00
github-actions[bot] commented 2026年03月17日 02:18:37 +01:00 (Migrated from github.com)
Copy link

Mobile UI Screenshot

zop mobile UI

### Mobile UI Screenshot ![zop mobile UI](https://raw.githubusercontent.com/peterwwillis/zop/ui-screenshots/pr-14/zop-mobile-ui.png) <!-- Sticky Pull Request Commentzop-mobile-ui -->
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026年03月17日 02:19:33 +01:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment
Copy link

Pull request overview

Adds a manual workflow_dispatch entry point to the release workflow so maintainers can re-run releases for an existing tag without pushing a new tag, while ensuring all jobs build from the intended tag ref.

Changes:

  • Add workflow_dispatch trigger with required tag input.
  • Introduce resolve-tag job to select/validate the tag and expose it as an output.
  • Update downstream jobs to depend on resolve-tag and check out the resolved tag; adjust release metadata to use the resolved tag.
## Pull request overview Adds a manual `workflow_dispatch` entry point to the release workflow so maintainers can re-run releases for an existing tag without pushing a new tag, while ensuring all jobs build from the intended tag ref. **Changes:** - Add `workflow_dispatch` trigger with required `tag` input. - Introduce `resolve-tag` job to select/validate the tag and expose it as an output. - Update downstream jobs to depend on `resolve-tag` and check out the resolved tag; adjust release metadata to use the resolved tag.
@ -4,21 +4,67 @@ on:
push:
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026年03月17日 02:19:33 +01:00
Copy link

The concurrency group value differs between push and manual dispatch for the same tag (push uses github.ref like refs/tags/v1.2.3, while dispatch uses inputs.tag like v1.2.3). This prevents the intended per-tag deduplication and can allow two workflows for the same tag to run concurrently. Consider normalizing both paths to the same shape (e.g., use github.ref_name for the push case, or prefix the dispatch input with refs/tags/).

The concurrency group value differs between push and manual dispatch for the same tag (push uses `github.ref` like `refs/tags/v1.2.3`, while dispatch uses `inputs.tag` like `v1.2.3`). This prevents the intended per-tag deduplication and can allow two workflows for the same tag to run concurrently. Consider normalizing both paths to the same shape (e.g., use `github.ref_name` for the push case, or prefix the dispatch input with `refs/tags/`).
@ -17,0 +48,4 @@
printf 'tag=%s\n' "$REF_NAME" >> "$GITHUB_OUTPUT"
fi
- name:Validate tag exists
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026年03月17日 02:19:33 +01:00
Copy link

inputs.tag is interpolated directly into a bash script via ${{ ... }} (and then written to $GITHUB_OUTPUT). A crafted tag containing quotes/newlines could break out of the string and run arbitrary shell commands or inject additional outputs. To harden this, pass the tag value via env: (or read it from the event payload), use safe quoting (e.g. printf), and validate/sanitize the tag to disallow newlines and other unsafe characters before writing to $GITHUB_OUTPUT.

`inputs.tag` is interpolated directly into a bash script via `${{ ... }}` (and then written to `$GITHUB_OUTPUT`). A crafted tag containing quotes/newlines could break out of the string and run arbitrary shell commands or inject additional outputs. To harden this, pass the tag value via `env:` (or read it from the event payload), use safe quoting (e.g. `printf`), and validate/sanitize the tag to disallow newlines and other unsafe characters before writing to `$GITHUB_OUTPUT`.
peterwwillis commented 2026年03月17日 02:20:40 +01:00 (Migrated from github.com)
Copy link

@copilot apply changes based on the comments in this thread

@copilot apply changes based on the comments in [this thread](https://github.com/peterwwillis/zop/pull/14#pullrequestreview-3957671054)
Copilot commented 2026年03月17日 02:22:35 +01:00 (Migrated from github.com)
Copy link

@copilot apply changes based on the comments in this thread

Done in e40369a. Two fixes applied:

  1. Concurrency group — changed github.refgithub.ref_name so both the push path (refs/tags/v1.2.3v1.2.3) and the dispatch path (inputs.tag = v1.2.3) produce the same string, enabling correct per-tag deduplication.

  2. Shell injectioninputs.tag is now passed through env: (INPUT_TAG) instead of being interpolated directly into the bash script. The value is validated against a POSIX character allowlist ([^a-zA-Z0-9._/\-]) before being written to $GITHUB_OUTPUT via printf. The "Validate tag exists" step also uses env: for the tag output value.

> @copilot apply changes based on the comments in [this thread](https://github.com/peterwwillis/zop/pull/14#pullrequestreview-3957671054) Done in e40369a. Two fixes applied: 1. **Concurrency group** — changed `github.ref` → `github.ref_name` so both the push path (`refs/tags/v1.2.3` → `v1.2.3`) and the dispatch path (`inputs.tag` = `v1.2.3`) produce the same string, enabling correct per-tag deduplication. 2. **Shell injection** — `inputs.tag` is now passed through `env:` (`INPUT_TAG`) instead of being interpolated directly into the bash script. The value is validated against a POSIX character allowlist (`[^a-zA-Z0-9._/\-]`) before being written to `$GITHUB_OUTPUT` via `printf`. The "Validate tag exists" step also uses `env:` for the tag output value.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mutablecc/zop!14
Reference in a new issue
mutablecc/zop
No description provided.
Delete branch "copilot/modify-release-workflow-manual-trigger"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?