Skip to content

Commit 5f36ff9

Browse files
committed
fix(workflow): correct syntax error in the if block
1 parent e64a6dc commit 5f36ff9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

.github/workflows/release-pr-versioncode.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ permissions:
1212

1313
jobs:
1414
set-versioncode:
15-
# Only run on release-please PRs (they carry the "autorelease: pending" label)
16-
if: ${{ contains(github.event.pull_request.labels.*.name, 'autorelease: pending') }}
15+
# Run only on release-please PR branches
16+
if: ${{ startsWith(github.event.pull_request.head.ref, 'release-please--') }}
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout PR branch
@@ -26,19 +26,14 @@ jobs:
2626
- name: Sanity check file presence
2727
run: |
2828
ls -la Assets || true
29-
if [ ! -f Assets/version.txt ]; then
30-
echo "Assets/version.txt not found on PR branch."
31-
echo "Tip: ensure release-please updates this path (extra-files) and the file exists in main."
32-
fi
29+
test -f Assets/version.txt && echo "Found Assets/version.txt" || echo "Missing Assets/version.txt"
3330
3431
- name: Compute versionCode from semver in manifest
3532
shell: bash
3633
run: |
37-
# Read the next version from release-please manifest in the PR
3834
VER=$(jq -r '."."' .github/.release-please-manifest.json)
3935
echo "Next version is: $VER"
4036
41-
# Extract MAJOR.MINOR.PATCH (ignore prerelease/build metadata if present)
4237
if [[ "$VER" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
4338
MAJOR=${BASH_REMATCH[1]}
4439
MINOR=${BASH_REMATCH[2]}
@@ -48,12 +43,9 @@ jobs:
4843
exit 1
4944
fi
5045
51-
# Monotonic integer strategy for Google Play:
52-
# versionCode = MAJOR*10000 + MINOR*100 + PATCH (e.g., 2.3.4 -> 20304)
5346
CODE=$((MAJOR*10000 + MINOR*100 + PATCH))
5447
echo "Computed versionCode: $CODE"
5548
56-
# Write into Assets/ (not repo root)
5749
echo $CODE > Assets/versionCode.txt
5850
5951
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)