Skip to content

refactor(static-analysis-report): build gh-aw from source instead of installing a release#25556

Merged
pelikhan merged 2 commits intomainfrom
copilot/refactor-static-analysis-workflow
Apr 10, 2026
Merged

refactor(static-analysis-report): build gh-aw from source instead of installing a release#25556
pelikhan merged 2 commits intomainfrom
copilot/refactor-static-analysis-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

The static analysis workflow was installing gh-aw from the latest published release via gh extension install, meaning it always lagged behind HEAD and couldn't reflect unreleased changes.

Changes

  • Build step: replaced gh extension install github/gh-aw with make build, producing a binary from the current source tree
  • Binary invocation: updated compile step to use $GITHUB_WORKSPACE/gh-aw consistently (both version check and compile --zizmor --poutine --actionlint --runner-guard)
  • Network: added network.allowed: [defaults, go] to permit Go module proxy access during the build
  • Lock file: recompiled — 0 errors, 0 warnings

@pelikhan pelikhan marked this pull request as ready for review April 10, 2026 00:13
Copilot AI review requested due to automatic review settings April 10, 2026 00:13
@pelikhan pelikhan merged commit e9a378d into main Apr 10, 2026
54 of 55 checks passed
@pelikhan pelikhan deleted the copilot/refactor-static-analysis-workflow branch April 10, 2026 00:14
Copy link
Copy Markdown
Contributor

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

Updates the static analysis agentic workflow to use a gh-aw binary built from the current repository source (instead of installing the latest published gh extension release), and expands the workflow’s network allowlist to support Go module downloads during the build.

Changes:

  • Replace gh extension install github/gh-aw with make build and run the resulting binary from the workspace.
  • Update compilation step to invoke $GITHUB_WORKSPACE/gh-aw compile ... consistently.
  • Allow Go-related network domains via network.allowed: [defaults, go] and regenerate the compiled lock workflow.
Show a summary per file
File Description
.github/workflows/static-analysis-report.md Builds gh-aw from repo source, runs the workspace binary for version/compile, and adds Go network allowlist.
.github/workflows/static-analysis-report.lock.yml Recompiled workflow reflecting the source-build step, updated invocation paths, and expanded allowed domains.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines 78 to +82
echo "Running gh aw compile with security tools to download Docker images..."

# Run compile with all security scanner flags to download Docker images
# Store the output in a file for inspection
gh aw compile --zizmor --poutine --actionlint --runner-guard 2>&1 | tee /tmp/gh-aw/compile-output.txt
$GITHUB_WORKSPACE/gh-aw compile --zizmor --poutine --actionlint --runner-guard 2>&1 | tee /tmp/gh-aw/compile-output.txt
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The compile … | tee … pipeline will mask a non-zero exit code from gh-aw because set -e doesn’t propagate failures through pipes unless pipefail is enabled. This can make the workflow appear successful even if compile fails and /tmp/gh-aw/compile-output.txt is incomplete. Consider enabling set -o pipefail (or otherwise capturing the gh-aw exit status) before piping to tee so failures correctly fail the step.

Copilot uses AI. Check for mistakes.
Comment on lines +375 to +379
- name: Build gh-aw from source
run: |
if gh extension list | grep -q "github/gh-aw"; then
gh extension upgrade gh-aw || true
else
gh extension install github/gh-aw
fi
gh aw --version
set -e
make build
$GITHUB_WORKSPACE/gh-aw --version
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This job already builds and places a ./gh-aw binary earlier (see the generated "Build gh-aw CLI" step), and this step rebuilds it again via make build. If the intent is to use the Makefile build (e.g., to run the sync targets before embedding), consider updating the primary build step to use make build instead of adding a second build, or otherwise avoid rebuilding twice to save time and reduce duplicate Go module downloads.

See below for a potential fix:

      - name: Verify prebuilt gh-aw binary
        run: |
          set -e
          test -x "$GITHUB_WORKSPACE/gh-aw"

Copilot uses AI. Check for mistakes.
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