[codex] add agent CLI release workflow#1
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the Slack posting tool into the repository’s new multi-binary Go CLI layout and adds build, package, CI, and release automation for independently versioned agent-facing binaries.
Changes:
- Moves
slack-postinto a Cobra-basedcmd/slack-postentrypoint with internal command logic and tests. - Adds Go module files, Makefile targets, CI, and release workflow for per-binary SemVer archives.
- Adds command docs, environment templates, and agent skill documentation for building/releasing binaries.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
slack-post/slack-post.go |
Removes the old standalone Slack posting implementation. |
README.md |
Documents repository shape, build/test commands, release tags, and install example. |
Makefile |
Adds build, package, tag, release archive, and validation targets. |
internal/cli/slackpost/command.go |
Adds testable Cobra command implementation for posting Slack messages. |
internal/cli/slackpost/command_test.go |
Adds focused command tests for success and error behavior. |
go.mod |
Defines the Go module and Cobra dependency. |
go.sum |
Adds dependency checksums. |
cmd/slack-post/main.go |
Adds thin binary entrypoint with version stamping support. |
cmd/slack-post/README.md |
Adds usage, input, output, build, and package docs for the tool. |
cmd/slack-post/.env.example |
Adds Slack-related environment variable template. |
.gitignore |
Ignores generated distribution artifacts. |
.github/workflows/ci.yml |
Adds pull request/main branch test and build workflow. |
.github/workflows/release.yml |
Adds tag/dispatch release packaging and GitHub release publication workflow. |
.agents/skills/release-agent-binaries/SKILL.md |
Adds release workflow guidance for agent-operated binary publishing. |
.agents/skills/release-agent-binaries/agents/openai.yaml |
Adds agent metadata for the release skill. |
.agents/skills/build-go-cobra-clis/SKILL.md |
Updates CLI-building guidance to include colocated docs and env templates. |
Comments suppressed due to low confidence (6)
Makefile:87
TOOLis interpolated directly into shell recipes before any character validation, and the release workflow derives it from tag/dispatch input. A tool value containing shell metacharacters can break out of these quoted strings before the directory check completes; validateTOOLagainst the allowed binary-name pattern before using it in any recipe command.
@if [ ! -d "cmd/$(TOOL)" ]; then \
echo "unknown TOOL=$(TOOL); available: $(BINS)" >&2; \
Makefile:98
VERSIONis expanded into the shell command before the SemVer validation runs. A tag or workflow-dispatch value containing shell metacharacters could execute in the release job beforegreprejects it; avoid interpolating raw make variables into shell syntax or validate/sanitize the value before this point.
@if ! printf '%s\n' "$(VERSION)" | grep -Eq '$(SEMVER_PATTERN)'; then \
echo "VERSION must be SemVer with a leading v, e.g. v0.1.0" >&2; \
exit 2; \
Makefile:62
- The nested loop does not stop on a failed
packageinvocation; withoutset -eor|| exit, the target can still exit successfully if a later OS/arch package succeeds. That can leave a partial set of archives while reporting release success.
release-archives: check-tool check-version
@for os in $(RELEASE_OSES); do \
for arch in $(RELEASE_ARCHES); do \
$(MAKE) --no-print-directory package TOOL="$(TOOL)" VERSION="$(VERSION)" GOOS="$$os" GOARCH="$$arch"; \
done; \
done
Makefile:55
- This multi-command recipe does not enable
set -e, so a failedgo buildortarcan be followed by the finalecho, causingmake packageto exit 0 even though no valid archive was produced. Make the shell fail fast or explicitly chain the commands so packaging errors propagate.
@tmp_dir="$$(mktemp -d)"; \
trap 'rm -rf "$$tmp_dir"' EXIT; \
echo "packaging $(TOOL) $(VERSION) for $(GOOS)/$(GOARCH)"; \
GOOS="$(GOOS)" GOARCH="$(GOARCH)" CGO_ENABLED=0 \
go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o "$$tmp_dir/$(TOOL)" "./cmd/$(TOOL)"; \
tar -C "$$tmp_dir" -czf "$(ARCHIVE)" "$(TOOL)"; \
echo "$(ARCHIVE)"
Makefile:45
build-toolstampsVERSIONinto the binary but does not runcheck-version, somake build-tool TOOL=slack-post VERSION=not-semversucceeds and produces a binary whose--versioncannot be released. Add version validation whenVERSIONis provided, or document that this target intentionally accepts arbitrary build metadata.
build-tool: check-tool
@mkdir -p "$(DIST_DIR)"
go build -trimpath -ldflags "-s -w -X main.version=$(BUILD_VERSION)" -o "$(DIST_DIR)/$(TOOL)" "./cmd/$(TOOL)"
.github/workflows/release.yml:50
- Workflow-dispatch inputs are interpolated directly into the bash script before execution. An input containing quotes or command substitutions can alter the script; pass these values through step
envvariables or otherwise validate/quote them before use.
tool="${{ inputs.tool }}"
version="${{ inputs.version }}"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
slack-postinto a testable Cobra-based command undercmd/slack-postwith internal command logic and focused tests.cmd/slack-post/.Why
Test Plan
go test ./...go vet ./...make buildmake package TOOL=slack-post VERSION=v0.1.0 GOOS=linux GOARCH=amd64tar -tzf dist/slack-post_v0.1.0_linux_amd64.tar.gzdist/slack-post --versiondist/slack-post --helpgit diff --cached --check && git diff --checkquick_validate.py .agents/skills/release-agent-binariesin a throwaway venv with PyYAML installed