|
27 | 27 | - name: Checkout repository |
28 | 28 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
29 | 29 | with: |
30 | | - fetch-depth: 0 |
31 | 30 | persist-credentials: false |
32 | 31 |
|
33 | 32 | - name: Setup Node.js |
|
57 | 56 | apply-updates: |
58 | 57 | name: Apply updates with Claude Code |
59 | 58 | needs: check-updates |
60 | | - if: needs.check-updates.outputs.has-updates == 'true' && inputs.dry-run != true |
| 59 | + if: needs.check-updates.outputs.has-updates == 'true' && github.event.inputs.dry-run != 'true' |
61 | 60 | runs-on: ubuntu-latest |
62 | 61 | permissions: |
63 | 62 | contents: write |
|
67 | 66 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
68 | 67 | with: |
69 | 68 | fetch-depth: 0 |
70 | | - persist-credentials: false |
71 | 69 |
|
72 | 70 | - name: Setup Node.js |
73 | 71 | uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 |
@@ -101,18 +99,17 @@ jobs: |
101 | 99 | CI: 'true' |
102 | 100 | GITHUB_ACTIONS: 'true' |
103 | 101 | run: | |
| 102 | + set -o pipefail |
104 | 103 | if [ -z "$ANTHROPIC_API_KEY" ]; then |
105 | 104 | echo "⚠️ ANTHROPIC_API_KEY not set - skipping automated update" |
106 | 105 | echo "success=false" >> $GITHUB_OUTPUT |
107 | 106 | exit 0 |
108 | 107 | fi |
109 | 108 |
|
110 | | - claude --print --dangerously-skip-permissions \ |
| 109 | + if claude --print --dangerously-skip-permissions \ |
111 | 110 | --model sonnet \ |
112 | 111 | "/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." \ |
113 | | - 2>&1 | tee claude-output.log |
114 | | -
|
115 | | - if [ $? -eq 0 ]; then |
| 112 | + 2>&1 | tee claude-output.log; then |
116 | 113 | echo "success=true" >> $GITHUB_OUTPUT |
117 | 114 | else |
118 | 115 | echo "success=false" >> $GITHUB_OUTPUT |
@@ -142,26 +139,33 @@ jobs: |
142 | 139 | COMMITS=$(git log --oneline origin/main..HEAD) |
143 | 140 | COMMIT_COUNT=$(git rev-list --count origin/main..HEAD) |
144 | 141 |
|
145 | | - gh pr create \ |
146 | | - --title "chore(deps): weekly dependency update ($(date +%Y-%m-%d))" \ |
147 | | - --body "## Weekly Dependency Update |
| 142 | + BODY=$(cat <<EOF |
| 143 | + ## Weekly Dependency Update |
| 144 | +
|
| 145 | + Automated weekly update of npm packages. |
148 | 146 |
|
149 | | -Automated weekly update of npm packages. |
| 147 | + ### Commits (${COMMIT_COUNT}) |
150 | 148 |
|
151 | | -### Commits (${COMMIT_COUNT}) |
| 149 | + <details> |
| 150 | + <summary>View commit history</summary> |
152 | 151 |
|
153 | | -<details> |
154 | | -<summary>View commit history</summary> |
| 152 | + \`\`\` |
| 153 | + ${COMMITS} |
| 154 | + \`\`\` |
155 | 155 |
|
156 | | -\`\`\` |
157 | | -${COMMITS} |
158 | | -\`\`\` |
| 156 | + </details> |
159 | 157 |
|
160 | | -</details> |
| 158 | + --- |
161 | 159 |
|
162 | | ---- |
| 160 | + <sub>Generated by [weekly-update.yml](.github/workflows/weekly-update.yml)</sub> |
| 161 | + EOF |
| 162 | + ) |
| 163 | + # Strip leading whitespace from heredoc lines |
| 164 | + BODY=$(echo "$BODY" | sed 's/^ //') |
163 | 165 |
|
164 | | -<sub>Generated by [weekly-update.yml](.github/workflows/weekly-update.yml)</sub>" \ |
| 166 | + gh pr create \ |
| 167 | + --title "chore(deps): weekly dependency update ($(date +%Y-%m-%d))" \ |
| 168 | + --body "$BODY" \ |
165 | 169 | --draft \ |
166 | 170 | --head "$BRANCH_NAME" \ |
167 | 171 | --base main |
|
0 commit comments