Skip to content

Commit 67ebc13

Browse files
committed
fix(ci): check-publish job should check .changes/pre.json
1 parent cbfd428 commit 67ebc13

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/covector-version-or-publish.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ permissions:
1919
pull-requests: write
2020

2121
jobs:
22-
# covector publishes once no change files are left (the version update PR consumed them) and
23-
# otherwise opens that PR, which does not need the tests below.
22+
# covector publishes once no pending change files are left (the version update PR consumed them)
23+
# and otherwise opens that PR, which does not need the tests below. In pre-release mode the
24+
# change files stay in `.changes` and `pre.json` lists the ones already released.
2425
check-publish:
2526
runs-on: ubuntu-latest
2627
outputs:
@@ -29,7 +30,12 @@ jobs:
2930
- uses: actions/checkout@v7
3031
- id: check
3132
run: |
32-
if find .changes -maxdepth 1 -name '*.md' ! -iname 'readme.md' | grep -q .; then
33+
released=$(if [ -f .changes/pre.json ]; then jq -r '.changes[]' .changes/pre.json; fi)
34+
# grep exits 1 when every change file was released; any other failure fails the step
35+
pending=$(find .changes -maxdepth 1 -name '*.md' ! -iname 'readme.md' \
36+
| { grep -vxF -e "$released" || [ $? -eq 1 ]; })
37+
if [ -n "$pending" ]; then
38+
printf 'pending change files:\n%s\n' "$pending"
3339
echo "publish=false" >> "$GITHUB_OUTPUT"
3440
else
3541
echo "publish=true" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)