Skip to content

Commit 04e344c

Browse files
authored
fix(ci): repair broken weekly-update workflow YAML (#73)
* fix(ci): repair broken weekly-update workflow YAML The workflow was invalid YAML since creation — the `gh pr create --body` multiline string had unindented continuation lines that broke the YAML block scalar. Also fixes exit code capture (PIPESTATUS instead of $?) after pipe to tee, and adds token-based auth for git push since persist-credentials is disabled. * chore: add zizmor config to disable secrets-outside-env * fix: wrap zizmor config under rules key
1 parent d87bee2 commit 04e344c

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.github/workflows/weekly-update.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,15 @@ jobs:
107107
exit 0
108108
fi
109109
110+
set +e
110111
claude --print --dangerously-skip-permissions \
111112
--model sonnet \
112113
"/updating - Run the updating skill to update all dependencies. Create atomic commits for each update. You are running in CI mode - skip builds and tests. Do not push or create a PR." \
113114
2>&1 | tee claude-output.log
115+
CLAUDE_EXIT=${PIPESTATUS[0]}
116+
set -e
114117
115-
if [ $? -eq 0 ]; then
118+
if [ "$CLAUDE_EXIT" -eq 0 ]; then
116119
echo "success=true" >> $GITHUB_OUTPUT
117120
else
118121
echo "success=false" >> $GITHUB_OUTPUT
@@ -130,8 +133,11 @@ jobs:
130133
- name: Push branch
131134
if: steps.claude.outputs.success == 'true' && steps.changes.outputs.has-changes == 'true'
132135
env:
136+
GH_TOKEN: ${{ github.token }}
133137
BRANCH_NAME: ${{ steps.branch.outputs.branch }}
134-
run: git push origin "$BRANCH_NAME"
138+
run: |
139+
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
140+
git push origin "$BRANCH_NAME"
135141
136142
- name: Create Pull Request
137143
if: steps.claude.outputs.success == 'true' && steps.changes.outputs.has-changes == 'true'
@@ -141,27 +147,27 @@ jobs:
141147
run: |
142148
COMMITS=$(git log --oneline origin/main..HEAD)
143149
COMMIT_COUNT=$(git rev-list --count origin/main..HEAD)
150+
PR_BODY="## Weekly Dependency Update
144151
145-
gh pr create \
146-
--title "chore(deps): weekly dependency update ($(date +%Y-%m-%d))" \
147-
--body "## Weekly Dependency Update
152+
Automated weekly update of npm packages.
148153
149-
Automated weekly update of npm packages.
154+
### Commits (${COMMIT_COUNT})
150155
151-
### Commits (${COMMIT_COUNT})
156+
<details>
157+
<summary>View commit history</summary>
152158
153-
<details>
154-
<summary>View commit history</summary>
159+
\`\`\`
160+
${COMMITS}
161+
\`\`\`
155162
156-
\`\`\`
157-
${COMMITS}
158-
\`\`\`
163+
</details>
159164
160-
</details>
165+
---
161166
162-
---
163-
164-
<sub>Generated by [weekly-update.yml](.github/workflows/weekly-update.yml)</sub>" \
167+
<sub>Generated by [weekly-update.yml](.github/workflows/weekly-update.yml)</sub>"
168+
gh pr create \
169+
--title "chore(deps): weekly dependency update ($(date +%Y-%m-%d))" \
170+
--body "$PR_BODY" \
165171
--draft \
166172
--head "$BRANCH_NAME" \
167173
--base main

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
secrets-outside-env:
3+
disable: true

0 commit comments

Comments
 (0)