Skip to content

Commit 1d4c077

Browse files
committed
fix release docs-update step + restore stripped version refs
The release workflow's "Update documentation with released version" step re-reads release.properties to get TAG and VERSION, but release:perform deletes that file as part of its cleanup. When the step runs, grep returns nothing, VERSION is empty, and the sed commands strip versions from README and the bug-report template with no replacement. Commit 8ca2836 ("docs: update version references to ", trailing space) shows it firing during the v0.4.1 release in April. Step 1 already exports `version` to $GITHUB_OUTPUT before release:perform runs, so the docs step can consume it directly. Switch to that, add an empty-value guard so a future regression fails loudly, and pass the value in via `env:` per GitHub Actions injection-prevention guidance. Also restore the version refs that the prior failure left empty: - README Gradle dependency line: 1.0.0-SNAPSHOT - bug-report template Library version example: 1.0.0
1 parent b90ef39 commit 1d4c077

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ labels: bug
88
Clear, concise description of the bug.
99

1010
## Environment
11-
- Library version: (e.g., )
11+
- Library version: (e.g., 1.0.0)
1212
- Java version: (e.g., 17.0.11)
1313
- OS: (e.g., macOS 14, Ubuntu 22.04, Windows 11)
1414
- File access backend: (ZipFileAccess, LocalFileAccess, S3 v1/v2, custom)

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ jobs:
5151
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5252

5353
- name: Update documentation with released version
54+
env:
55+
# Consume the version exported by the publish step. release.properties
56+
# is unreliable here because release:perform deletes it during cleanup.
57+
VERSION: ${{ steps.publish.outputs.version }}
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5459
run: |
55-
TAG=$(grep 'scm.tag=' release.properties | cut -d'=' -f2)
56-
VERSION=${TAG#v}
60+
if [[ -z "$VERSION" ]]; then
61+
echo "::error::Empty version output from publish step; refusing to strip doc versions"
62+
exit 1
63+
fi
5764
5865
# Update Maven dependency version (only the line after the library artifactId)
5966
sed -i '/<artifactId>elearning-module-parser<\/artifactId>/{n;s/<version>.*<\/version>/<version>'"${VERSION}"'<\/version>/}' README.md
@@ -67,8 +74,6 @@ jobs:
6774
git add README.md .github/ISSUE_TEMPLATE/bug_report.md
6875
git commit -m "docs: update version references to ${VERSION}"
6976
git push
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7277
7378
# Attestations and the GitHub Release SBOM upload run in a separate job so
7479
# the OIDC token (id-token: write) and attestations: write permission are

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ The library is published to Maven Central.
4949
<dependency>
5050
<groupId>dev.jcputney</groupId>
5151
<artifactId>elearning-module-parser</artifactId>
52-
<version></version>
52+
<version>1.0.0-SNAPSHOT</version>
5353
</dependency>
5454
```
5555

5656
### Gradle (Kotlin DSL)
5757

5858
```kotlin
59-
implementation("dev.jcputney:elearning-module-parser:")
59+
implementation("dev.jcputney:elearning-module-parser:1.0.0-SNAPSHOT")
6060
```
6161

6262
### Optional dependencies

0 commit comments

Comments
 (0)