Skip to content

Commit f5db670

Browse files
committed
fix(workflow): correct syntax issue of the if block
1 parent 09acb99 commit f5db670

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ name: Update versionCode in Release PR
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, labeled]
6-
branches: [ "main" ]
6+
branches: ["main"]
77

88
permissions:
99
contents: write
10+
pull-requests: write
11+
issues: write
1012

1113
jobs:
1214
set-versioncode:
13-
# Only run on Release PRs opened by release-please (they carry this label)
14-
if: contains(join(fromJson(toJson(github.event.pull_request.labels)).*.name, ','), 'autorelease: pending')
15+
# Only run on release-please PRs (they carry the "autorelease: pending" label)
16+
if: ${{ contains(github.event.pull_request.labels.*.name, 'autorelease: pending') }}
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Checkout PR branch
@@ -21,7 +23,16 @@ jobs:
2123
repository: ${{ github.event.pull_request.head.repo.full_name }}
2224
fetch-depth: 0
2325

26+
- name: Sanity check file presence
27+
run: |
28+
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
33+
2434
- name: Compute versionCode from semver in manifest
35+
shell: bash
2536
run: |
2637
# Read the next version from release-please manifest in the PR
2738
VER=$(jq -r '."."' .github/.release-please-manifest.json)

Assets/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.0
1+
0.0.0 x-release-please-version

0 commit comments

Comments
 (0)