Skip to content

Quote workflow shell repository expansions to clear SC2086 findings - #48798

Merged
pelikhan merged 3 commits into
mainfrom
copilot/static-analysis-report-2026-07-29
Jul 29, 2026
Merged

Quote workflow shell repository expansions to clear SC2086 findings#48798
pelikhan merged 3 commits into
mainfrom
copilot/static-analysis-report-2026-07-29

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Static analysis reported actionlint/ShellCheck SC2086 warnings in generated workflow run: blocks. The remaining hits came from unquoted repository-related shell expansions in one shared PR prefetch fragment and one workflow-local GEO audit command.

  • Shared PR prefetch quoting

    • Updated .github/workflows/shared/pr-diff-data-fetch.md to quote EXPR_GITHUB_REPOSITORY in gh pr diff and gh pr view.
    • This removes the duplicated SC2086 findings emitted into:
      • impeccable-skills-reviewer.lock.yml
      • mattpocock-skills-reviewer.lock.yml
      • pr-code-quality-reviewer.lock.yml
  • Geo optimizer URL quoting

    • Updated .github/workflows/daily-geo-optimizer.md to quote the repository URL passed to geo audit.
    • This removes the remaining SC2086 hit in daily-geo-optimizer.lock.yml.
  • Regenerated compiled workflows

    • Recompiled the affected .lock.yml files so the source and generated workflows stay in sync with the quoting changes.
  • Focused regression coverage

    • Extended pkg/cli/pr_prefetch_cache_contract_test.go with assertions that pin the quoted shared prefetch commands and the quoted GEO audit URL.

Example of the change:

# before
gh pr diff "$PR_NUMBER" --repo $EXPR_GITHUB_REPOSITORY
geo audit --url https://github.com/${{ github.repository }} --format json

# after
gh pr diff "$PR_NUMBER" --repo "$EXPR_GITHUB_REPOSITORY"
geo audit --url "https://github.com/${{ github.repository }}" --format json

Copilot AI linked an issue Jul 29, 2026 that may be closed by this pull request
6 tasks
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update static analysis findings for 2026-07-29 Quote workflow shell repository expansions to clear SC2086 findings Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 07:58
- name: Audit README via GitHub repository page
run: |
geo audit --url https://github.com/${{ github.repository }} --format json \
geo audit --url "https://github.com/${{ github.repository }}" --format json \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot always use env vars

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 19a6797.

assert.Contains(t, text, "pr-data-head-sha.txt", "Shared PR prefetch should persist head SHA marker")
assert.Contains(t, text, "--json number,title,body,headRefName,headRefOid,additions,deletions,changedFiles,files", "Shared PR prefetch should capture head SHA in metadata")
assert.Contains(t, text, "Cache hit: using pre-fetched PR data for head", "Shared PR prefetch should verify cache by current head SHA")
assert.Contains(t, text, `gh pr diff "$PR_NUMBER" --repo "$EXPR_GITHUB_REPOSITORY"`, "Shared PR prefetch should quote repository on gh pr diff")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot delete this test file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed my changes from this test file in 19a6797.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 08:36
Copilot AI review requested due to automatic review settings July 29, 2026 08:36
Copilot AI requested a review from pelikhan July 29, 2026 08:37
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #48798 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Quotes repository-related shell expansions to resolve SC2086 findings in generated workflows.

Changes:

  • Quotes shared PR-prefetch repository arguments.
  • Introduces a quoted GEO repository URL environment variable.
  • Regenerates affected workflow lock files.
Show a summary per file
File Description
.github/workflows/shared/pr-diff-data-fetch.md Quotes gh pr repository arguments.
.github/workflows/pr-code-quality-reviewer.lock.yml Regenerates shared prefetch logic.
.github/workflows/mattpocock-skills-reviewer.lock.yml Regenerates shared prefetch logic.
.github/workflows/impeccable-skills-reviewer.lock.yml Regenerates shared prefetch logic.
.github/workflows/daily-geo-optimizer.md Safely supplies the GEO audit repository URL.
.github/workflows/daily-geo-optimizer.lock.yml Regenerates the GEO optimizer workflow.

Review details

Tip

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

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Medium

- name: Audit README via GitHub repository page
run: |
geo audit --url https://github.com/${{ github.repository }} --format json \
geo audit --url "$REPOSITORY_URL" --format json \
echo "Cache hit: using pre-fetched PR data for head ${CURRENT_HEAD_SHA} (${LINES} diff lines, ${COMMENT_COUNT} review comments)"
else
{ gh pr diff "$PR_NUMBER" --repo $EXPR_GITHUB_REPOSITORY \
{ gh pr diff "$PR_NUMBER" --repo "$EXPR_GITHUB_REPOSITORY" \
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Quoting fixes for SC2086

Clean, mechanical fix. Verified the shared pr-diff-data-fetch.md quoting changes are correctly propagated into all three dependent lock files, and the geo-optimizer job-level REPOSITORY_URL env var change is consistent with the new os.environ["REPOSITORY_URL"]/os.environ["GITHUB_REPOSITORY"] usage in the Python heredoc.

Notes
  • GITHUB_REPOSITORY is a GitHub Actions default env var, always present at runtime, so bare dict access is safe.
  • REPOSITORY_URL is declared at job level, correctly threading through to the later Python step.
  • No correctness, security, or performance regressions found in the changed lines. No blocking issues.

🔎 Code quality review by PR Code Quality Reviewer · sonnet50 · 20.4 AIC · ⌖ 7.04 AIC · ⊞ 7.5K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review

Applied /codebase-design - changes are focused, consistent, and correct.

Root cause fixed in the shared source (pr-diff-data-fetch.md) so all three consumer lock files update correctly. The daily-geo-optimizer.md correctly uses an env block and os.environ access - the right pattern for passing GitHub context values. Lock files regenerated in sync. No blocking issues found.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 25.1 AIC · ⌖ 4.75 AIC · ⊞ 6.8K
Comment /matt to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The SC2086 fixes look correct and complete.

  • The REPOSITORY_URL env-var pattern in daily-geo-optimizer.md is the right approach: Actions expressions (${{ }}) cannot be double-quoted directly in shell, so hoisting the value into an env var and quoting "$REPOSITORY_URL" is idiomatic and safe.
  • Quoting "$EXPR_GITHUB_REPOSITORY" in the shared PR-prefetch fragment fixes the remaining ShellCheck findings without any behavioural change.
  • Lock files are correctly regenerated from the updated shared fragment.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 22.3 AIC · ⌖ 5.85 AIC · ⊞ 5.1K

@github-actions github-actions Bot mentioned this pull request Jul 29, 2026
@pelikhan
pelikhan merged commit fc2942a into main Jul 29, 2026
41 of 42 checks passed
@pelikhan
pelikhan deleted the copilot/static-analysis-report-2026-07-29 branch July 29, 2026 08:50
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.5

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.

[static-analysis] Report - 2026-07-29

3 participants