Skip to content

Add Go bin to PATH in verify-generation workflow - #12

Merged
gregmankes merged 2 commits into
developfrom
copilot/fix-github-actions-path-again
Feb 6, 2026
Merged

Add Go bin to PATH in verify-generation workflow#12
gregmankes merged 2 commits into
developfrom
copilot/fix-github-actions-path-again

Conversation

Copilot AI commented Feb 6, 2026

Copy link
Copy Markdown

The verify-generation job fails because go install ./cmd/gen-commands installs to $GOPATH/bin (~/go/bin), which is not in the GitHub Actions runner's default PATH.

Changes

  • Added step to append $HOME/go/bin to $GITHUB_PATH before running make gen in .github/workflows/build.yml
- name: Add Go bin to PATH
  run: echo "$HOME/go/bin" >> $GITHUB_PATH

This ensures the gen-commands binary is available when the Makefile invokes it at line 20.

Original prompt

Problem

The GitHub Actions workflow is failing because gen-commands binary installed via go install is not found in the PATH. The failure occurs in the "Check Generated Files" workflow at this job: https://github.com/temporalio/cloud-cli/actions/runs/21757553412/job/62771977077

Error Log

2026-02-06T16:18:43.0870158Z gen-commands -input ./temporalcloudcli/commands.yml -pkg temporalcloudcli > ./temporalcloudcli/commands.gen.go
2026-02-06T16:18:43.0883189Z /bin/sh: 1: gen-commands: not found
2026-02-06T16:18:43.0883854Z make: *** [Makefile:20: gen] Error 127

Root Cause

The Makefile's install rule runs go install ./cmd/gen-commands which installs the binary to $GOPATH/bin (typically ~/go/bin), but this directory is not in the PATH for the GitHub Actions runner.

Solution

Add a step in the .github/workflows/build.yml file to add the Go bin directory to the GitHub Actions PATH before running make gen.

In the verify-generation job, add a new step after the checkout step:

- name: Add Go bin to PATH
  run: echo "$HOME/go/bin" >> $GITHUB_PATH

This step should be inserted between the "Checkout repository" step and the "Run commands generation command" step (between lines 15 and 16).

Files to Modify

  • .github/workflows/build.yml - Add the new step to add Go bin to PATH in the verify-generation job

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: gregmankes <8827475+gregmankes@users.noreply.github.com>
@gregmankes
gregmankes marked this pull request as ready for review February 6, 2026 17:00
@gregmankes
gregmankes requested a review from a team as a code owner February 6, 2026 17:00
Copilot AI changed the title [WIP] Fix GitHub Actions workflow to include Go binary in PATH Add Go bin to PATH in verify-generation workflow Feb 6, 2026
Copilot AI requested a review from gregmankes February 6, 2026 17:01
@semgrep-managed-scans

Copy link
Copy Markdown

Semgrep found 1 missing-explicit-permissions finding:

No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).

@gregmankes
gregmankes merged commit 34c2986 into develop Feb 6, 2026
2 checks passed
@gregmankes
gregmankes deleted the copilot/fix-github-actions-path-again branch February 6, 2026 18:08
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.

3 participants