From eb336a1ee645f6a5f4599488e8b5b7dfd8737617 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Fri, 17 Oct 2025 11:32:23 +0100 Subject: [PATCH] Fix GitHub-Action Generate PR descriptions When `update-docs-version` ran, it created this PR - https://github.com/testcontainers/testcontainers-java/pull/11110: > Update docs version to ${GITHUB_REF##*/} Update docs version to ${GITHUB_REF##*/} The branch name was not expanded in the PR description, it uses Bash syntax not applicable outside of a `run` block Fixed by replacing Bash expansion to derive the branch name with the _actual_ branch name. --- .github/workflows/update-docs-version.yml | 6 +++--- .github/workflows/update-testcontainers-version.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-docs-version.yml b/.github/workflows/update-docs-version.yml index 5bbf47c3484..6e9981b19ac 100644 --- a/.github/workflows/update-docs-version.yml +++ b/.github/workflows/update-docs-version.yml @@ -20,14 +20,14 @@ jobs: ref: main - name: Update latest_version property in mkdocs.yml run: | - sed -i "s/latest_version: .*/latest_version: ${GITHUB_REF##*/}/g" mkdocs.yml + sed -i "s/latest_version: .*/latest_version: ${GITHUB_REF_NAME}/g" mkdocs.yml git diff - name: Create Pull Request uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v3.10.1 with: - title: Update docs version to ${GITHUB_REF##*/} + title: Update docs version to ${{ github.ref_name }} body: | - Update docs version to ${GITHUB_REF##*/} + Update docs version to ${{ github.ref_name }} skip-checks: true branch: update-docs-version delete-branch: true diff --git a/.github/workflows/update-testcontainers-version.yml b/.github/workflows/update-testcontainers-version.yml index 90d249c7d3f..9cf679e8952 100644 --- a/.github/workflows/update-testcontainers-version.yml +++ b/.github/workflows/update-testcontainers-version.yml @@ -20,13 +20,13 @@ jobs: ref: main - name: Update testcontainers.version property in gradle.properties run: | - sed -i "s/^testcontainers\.version=.*/testcontainers\.version=${GITHUB_REF##*/}/g" gradle.properties + sed -i "s/^testcontainers\.version=.*/testcontainers\.version=${GITHUB_REF_NAME}/g" gradle.properties git diff - name: Create Pull Request uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v3.10.1 with: - title: Update testcontainers version to ${GITHUB_REF##*/} + title: Update testcontainers version to ${{ github.ref_name }} body: | - Update testcontainers version to ${GITHUB_REF##*/} + Update testcontainers version to ${{ github.ref_name }} branch: update-tc-version delete-branch: true