Skip to content

Commit a9574fb

Browse files
Copilotdevakesugithub-actions[bot]
authored
fix(ci): resolve YAML syntax error and add IMAGE_NAME fallback (#385)
* Initial plan * Fix critical YAML syntax error and add IMAGE_NAME fallback - Fix line 198 syntax error in auto-version-bump.yml by adding proper indentation to template literal content - Add IMAGE_NAME fallback in release.yml to use repository name when secret is not set - Remove trailing spaces that were breaking YAML block structure Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * Clean up trailing spaces from all workflow files - Remove trailing spaces from all .yml and .yaml files in .github/workflows/ - This eliminates 156 yamllint errors - All workflow files still parse correctly Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * chore: auto-bump version to v1.6.5 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent beb89d1 commit a9574fb

File tree

8 files changed

+141
-140
lines changed

8 files changed

+141
-140
lines changed

.example.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
NEXT_PUBLIC_APP_NAME=GhostClass
4343

4444
# ⚠️ App Version (displayed in health checks and footer)
45-
NEXT_PUBLIC_APP_VERSION=1.6.4
45+
NEXT_PUBLIC_APP_VERSION=1.6.5
4646

4747
# ⚠️ Your production domain (without https://)
4848
# All URL-based variables are derived from this

.github/workflows/auto-version-bump.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ jobs:
4646
ref: ${{ github.head_ref }}
4747
token: ${{ secrets.GITHUB_TOKEN }}
4848
fetch-depth: 0
49-
49+
5050
- name: Checkout PR head (fork PR)
5151
if: steps.repo-check.outputs.is_same_repo == 'false'
5252
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5353
with:
5454
ref: ${{ github.event.pull_request.head.sha }}
5555
fetch-depth: 0
56-
56+
5757
- name: Import GPG key (same-repo only)
5858
if: steps.repo-check.outputs.is_same_repo == 'true'
5959
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
@@ -62,35 +62,35 @@ jobs:
6262
passphrase: ${{ secrets.GPG_PASSPHRASE }}
6363
git_user_signingkey: true
6464
git_commit_gpgsign: true
65-
65+
6666
- name: Setup Node.js
6767
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
6868
with:
6969
node-version: '20'
70-
70+
7171
- name: Check if version needs bump
7272
id: check
7373
run: |
7474
set -euo pipefail
75-
75+
7676
# Get current version from PR branch
7777
CURRENT=$(node -p "require('./package.json').version")
7878
echo "Current version on PR branch: ${CURRENT}"
79-
79+
8080
# Get version from main branch
8181
git fetch origin main
8282
MAIN_VERSION=$(git show origin/main:package.json | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf8')).version")
8383
echo "Version on main branch: ${MAIN_VERSION}"
84-
84+
8585
# Calculate next version for reference
8686
NEXT_VERSION=$(node -e "
8787
const version = '${MAIN_VERSION}';
8888
let parts = version.split('.').map(Number);
89-
89+
9090
// Normalize first
9191
if (parts[2] > 9) { parts[2] = 0; parts[1] += 1; }
9292
if (parts[1] > 9) { parts[1] = 0; parts[0] += 1; parts[2] = 0; }
93-
93+
9494
// Increment
9595
parts[2] += 1;
9696
if (parts[2] > 9) {
@@ -104,7 +104,7 @@ jobs:
104104
console.log(parts.join('.'));
105105
")
106106
echo "next_version=${NEXT_VERSION}" >> $GITHUB_OUTPUT
107-
107+
108108
# Check if version needs bump or already bumped
109109
if [ "$CURRENT" = "$MAIN_VERSION" ]; then
110110
echo "needs_bump=true" >> $GITHUB_OUTPUT
@@ -115,63 +115,63 @@ jobs:
115115
echo "current_version=$CURRENT" >> $GITHUB_OUTPUT
116116
echo "✓ Version already bumped (current: ${CURRENT}, main: ${MAIN_VERSION})"
117117
fi
118-
118+
119119
- name: Auto bump version (same-repo only)
120120
if: steps.repo-check.outputs.is_same_repo == 'true' && steps.check.outputs.needs_bump == 'true'
121121
id: bump
122122
run: |
123123
set -euo pipefail
124-
124+
125125
echo "Running bump-version.js script..."
126-
126+
127127
# Set environment for PR context
128128
export GITHUB_HEAD_REF="${{ github.head_ref }}"
129129
export CI="true"
130-
130+
131131
# Run the bump script
132132
node scripts/bump-version.js
133-
133+
134134
# Get the new version
135135
NEW_VERSION=$(node -p "require('./package.json').version")
136136
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
137137
echo "✓ Version bumped to ${NEW_VERSION}"
138-
138+
139139
# Configure git identity for commits
140140
# Note: GPG action configures signing, but we must explicitly set user identity
141141
git config user.name "github-actions[bot]"
142142
git config user.email "github-actions[bot]@users.noreply.github.com"
143-
143+
144144
# Stage and commit changes
145145
# Note: Files are explicitly listed (not git add -u) to ensure only version files are committed
146146
# This matches the files updated by bump-version.js
147147
git add package.json package-lock.json .example.env public/api-docs/openapi.yaml
148-
148+
149149
# Check if there are changes to commit
150150
if git diff --staged --quiet; then
151151
echo "⚠️ No changes to commit after running bump script"
152152
exit 0
153153
fi
154-
154+
155155
git commit -m "chore: auto-bump version to v${NEW_VERSION}"
156156
git push
157-
157+
158158
echo "✓ Changes committed and pushed"
159-
159+
160160
- name: Comment on PR (same-repo with auto-bump)
161161
if: steps.repo-check.outputs.is_same_repo == 'true' && steps.check.outputs.needs_bump == 'true' && steps.bump.outputs.new_version != ''
162162
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
163163
with:
164164
script: |
165165
const newVersion = '${{ steps.bump.outputs.new_version }}';
166-
166+
167167
// Check for existing bump comments to avoid spam on synchronize events
168168
const { data: comments } = await github.rest.issues.listComments({
169169
issue_number: context.issue.number,
170170
owner: context.repo.owner,
171171
repo: context.repo.repo,
172172
per_page: 100,
173173
});
174-
174+
175175
const bumpPrefix = '✅ **Version automatically bumped to';
176176
const existingBumpComment = comments
177177
.slice()
@@ -181,26 +181,26 @@ jobs:
181181
const hasPrefix = typeof comment.body === 'string' && comment.body.startsWith(bumpPrefix);
182182
return isBot && hasPrefix;
183183
});
184-
184+
185185
const isRebump = !!existingBumpComment;
186-
const rebumpNote = isRebump
187-
? '\n\n_Note: A previous automatic bump was performed. This is a re-bump after the PR was updated (e.g., rebased or synced with main)._'
186+
const rebumpNote = isRebump
187+
? '\n\n_Note: A previous automatic bump was performed. This is a re-bump after the PR was updated (e.g., rebased or synced with main)._'
188188
: '';
189-
189+
190190
await github.rest.issues.createComment({
191191
issue_number: context.issue.number,
192192
owner: context.repo.owner,
193193
repo: context.repo.repo,
194194
body: `✅ **Version automatically bumped to \`v${newVersion}\`**
195195
196-
This PR now includes the version bump commit.${rebumpNote}
196+
This PR now includes the version bump commit.${rebumpNote}
197197
198-
**Rollover versioning:** X.Y.Z where X ≥ 0 and Y, Z ∈ {0-9}
199-
- Example: 1.6.9 → 1.7.0, 1.9.9 → 2.0.0, 9.9.9 → 10.0.0
198+
**Rollover versioning:** X.Y.Z where X ≥ 0 and Y, Z ∈ {0-9}
199+
- Example: 1.6.9 → 1.7.0, 1.9.9 → 2.0.0, 9.9.9 → 10.0.0
200200
201-
This PR is ready for review! 🚀`
201+
This PR is ready for review! 🚀`
202202
});
203-
203+
204204
- name: Comment on PR (same-repo, already bumped)
205205
if: steps.repo-check.outputs.is_same_repo == 'true' && steps.check.outputs.needs_bump == 'false' && github.event.action != 'synchronize'
206206
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -213,11 +213,11 @@ This PR is ready for review! 🚀`
213213
repo: context.repo.repo,
214214
body: `✅ **Version already bumped to \`v${currentVersion}\`**
215215
216-
No automatic version bump needed - the PR already includes a version update.
216+
No automatic version bump needed - the PR already includes a version update.
217217
218-
This PR is ready for review! 🚀`
218+
This PR is ready for review! 🚀`
219219
});
220-
220+
221221
- name: Comment on PR (fork, needs bump)
222222
if: steps.repo-check.outputs.is_same_repo == 'false' && steps.check.outputs.needs_bump == 'true' && github.event.action != 'synchronize'
223223
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -231,29 +231,29 @@ This PR is ready for review! 🚀`
231231
repo: context.repo.repo,
232232
body: `👋 **Thank you for your contribution from a fork!**
233233
234-
Since this PR is from a forked repository, the automatic version bump cannot run (for security reasons).
234+
Since this PR is from a forked repository, the automatic version bump cannot run (for security reasons).
235235
236-
**Please manually bump the version before merging:**
236+
**Please manually bump the version before merging:**
237237
238-
\`\`\`bash
239-
# Current version on main: ${currentVersion}
240-
# Suggested next version: ${nextVersion}
238+
\`\`\`bash
239+
# Current version on main: ${currentVersion}
240+
# Suggested next version: ${nextVersion}
241241
242-
# From your PR branch, run the version bump script with PR context:
243-
CI=true GITHUB_HEAD_REF="$(git rev-parse --abbrev-ref HEAD)" node scripts/bump-version.js
244-
\`\`\`
242+
# From your PR branch, run the version bump script with PR context:
243+
CI=true GITHUB_HEAD_REF="$(git rev-parse --abbrev-ref HEAD)" node scripts/bump-version.js
244+
\`\`\`
245245
246-
The script will update:
247-
- \`package.json\` and \`package-lock.json\`
248-
- \`.example.env\` (NEXT_PUBLIC_APP_VERSION)
249-
- \`public/api-docs/openapi.yaml\`
246+
The script will update:
247+
- \`package.json\` and \`package-lock.json\`
248+
- \`.example.env\` (NEXT_PUBLIC_APP_VERSION)
249+
- \`public/api-docs/openapi.yaml\`
250250
251-
**Rollover versioning:** X.Y.Z where X ≥ 0 and Y, Z ∈ {0-9}
252-
- Example: 1.6.9 → 1.7.0, 1.9.9 → 2.0.0, 9.9.9 → 10.0.0
251+
**Rollover versioning:** X.Y.Z where X ≥ 0 and Y, Z ∈ {0-9}
252+
- Example: 1.6.9 → 1.7.0, 1.9.9 → 2.0.0, 9.9.9 → 10.0.0
253253
254-
For more details, see [VERSIONING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/docs/VERSIONING.md).`
254+
For more details, see [VERSIONING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/docs/VERSIONING.md).`
255255
});
256-
256+
257257
- name: Comment on PR (fork, already bumped)
258258
if: steps.repo-check.outputs.is_same_repo == 'false' && steps.check.outputs.needs_bump == 'false' && github.event.action != 'synchronize'
259259
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -266,7 +266,7 @@ For more details, see [VERSIONING.md](https://github.com/${context.repo.owner}/$
266266
repo: context.repo.repo,
267267
body: `✅ **Version already bumped to \`v${currentVersion}\`**
268268
269-
Great! This PR already includes a version update.
269+
Great! This PR already includes a version update.
270270
271-
This PR is ready for review! 🚀`
271+
This PR is ready for review! 🚀`
272272
});

.github/workflows/pipeline.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
name: Auto Tag Release
4141
needs: guard
4242
if: |
43-
github.event_name == 'push' &&
43+
github.event_name == 'push' &&
4444
github.ref == 'refs/heads/main'
4545
runs-on: ubuntu-latest
4646
permissions:
@@ -50,53 +50,53 @@ jobs:
5050
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5151
with:
5252
fetch-depth: 0
53-
53+
5454
- name: Import GPG key
5555
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
5656
with:
5757
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
5858
passphrase: ${{ secrets.GPG_PASSPHRASE }}
5959
git_tag_gpgsign: true
6060
git_user_signingkey: true
61-
61+
6262
- name: Setup Node.js
6363
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
6464
with:
6565
node-version: '20'
66-
66+
6767
- name: Create and push signed tag
6868
env:
6969
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
run: |
7171
set -euo pipefail
72-
72+
7373
VERSION=$(node -p "require('./package.json').version")
7474
VERSION_TAG="v${VERSION}"
75-
75+
7676
echo "Current version: ${VERSION}"
7777
echo "Tag to create: ${VERSION_TAG}"
78-
78+
7979
# Check if tag already exists
8080
if git ls-remote --tags origin | grep -q "refs/tags/${VERSION_TAG}$"; then
8181
echo "Tag ${VERSION_TAG} already exists, skipping"
8282
exit 0
8383
fi
84-
84+
8585
echo "Creating signed tag ${VERSION_TAG}"
86-
86+
8787
# Configure git identity for tagging (GPG action sets signing config)
8888
git config user.name "github-actions[bot]"
8989
git config user.email "github-actions[bot]@users.noreply.github.com"
90-
90+
9191
# Create signed annotated tag
9292
git tag -a "${VERSION_TAG}" -m "Release ${VERSION_TAG}"
93-
93+
9494
# Push tag (handle possible concurrent creation)
9595
set +e
9696
git push origin "${VERSION_TAG}"
9797
push_status=$?
9898
set -e
99-
99+
100100
if [ $push_status -ne 0 ]; then
101101
echo "git push for tag ${VERSION_TAG} failed with status ${push_status}, checking if tag exists on remote..."
102102
if git ls-remote --tags origin | grep -q "refs/tags/${VERSION_TAG}$"; then
@@ -106,16 +106,16 @@ jobs:
106106
exit $push_status
107107
fi
108108
fi
109-
109+
110110
echo "✓ Tag ${VERSION_TAG} created and pushed"
111-
111+
112112
# Trigger release workflow via repository_dispatch
113113
echo "Triggering release workflow via repository_dispatch"
114-
114+
115115
# Add retry logic for transient failures
116116
max_attempts=3
117117
attempt=1
118-
118+
119119
while [ $attempt -le $max_attempts ]; do
120120
if gh api repos/${{ github.repository }}/dispatches \
121121
--method POST \
@@ -127,12 +127,12 @@ jobs:
127127
echo "✓ Release workflow triggered for ${VERSION_TAG}"
128128
break
129129
fi
130-
130+
131131
if [ $attempt -eq $max_attempts ]; then
132132
echo "✗ Failed to trigger release workflow after ${max_attempts} attempts"
133133
exit 1
134134
fi
135-
135+
136136
echo "Retry attempt ${attempt}/${max_attempts} in 5s..."
137137
sleep 5
138138
attempt=$((attempt + 1))

0 commit comments

Comments
 (0)