Skip to content

Commit 34d5d99

Browse files
lpcoxCopilot
andcommitted
fix: address review feedback on pre-compute step
- Fix GITHUB_OUTPUT redirect: wrap gh api + delimiters in block redirect so output actually reaches the step output variable - Add if: guard for workflow_dispatch where PR number is absent - Network groups: kept as github-only since compiler auto-adds Claude API domains; api-proxy is not a standard network group Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e21e3e5 commit 34d5d99

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

.github/workflows/security-guard.lock.yml

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/security-guard.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ timeout-minutes: 10
2525
steps:
2626
- name: Fetch PR changed files
2727
id: pr-diff
28+
if: github.event.pull_request.number
2829
run: |
29-
echo "PR_FILES<<EOF" >> $GITHUB_OUTPUT
30-
gh api "repos/${GH_REPO}/pulls/${PR_NUMBER}/files" \
31-
--paginate --jq '.[] | "### \(.filename) (+\(.additions)/-\(.deletions))\n\(.patch // "(binary)")\n"' \
32-
| head -c 8000
33-
echo "EOF" >> $GITHUB_OUTPUT
30+
{
31+
echo "PR_FILES<<EOF"
32+
gh api "repos/${GH_REPO}/pulls/${PR_NUMBER}/files" \
33+
--paginate --jq '.[] | "### \(.filename) (+\(.additions)/-\(.deletions))\n\(.patch // \"(binary)\")\n"' \
34+
| head -c 8000
35+
echo "EOF"
36+
} >> "$GITHUB_OUTPUT"
3437
env:
3538
GH_TOKEN: ${{ github.token }}
3639
PR_NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)