From 585da6cfb37e320d98f7ca40fc9ea851b76a84b7 Mon Sep 17 00:00:00 2001 From: Ben Knutson Date: Wed, 18 Feb 2026 16:51:01 +0000 Subject: [PATCH] Refactor Github Action per b/485167538 --- .github/workflows/release.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43dd0ed29..5b6fc1a46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,16 +44,18 @@ jobs: - name: Bump Version Number run: | - mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" - mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" -pl eclipse_plugin + mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${GITHUB_EVENT_INPUTS_VERSION}" + mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${GITHUB_EVENT_INPUTS_VERSION}" -pl eclipse_plugin mvn tycho-versions:update-eclipse-metadata -pl eclipse_plugin git ls-files | grep -E '(pom.xml|MANIFEST.MF)$' | xargs git add - git config --global user.email "${{ github.actor }}@users.noreply.github.com" - git config --global user.name "${{ github.actor }}" - git commit -m "Release google-java-format ${{ github.event.inputs.version }}" - git tag "v${{ github.event.inputs.version }}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git config --global user.name "${GITHUB_ACTOR}" + git commit -m "Release google-java-format ${GITHUB_EVENT_INPUTS_VERSION}" + git tag "v${GITHUB_EVENT_INPUTS_VERSION}" echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV - git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git + git remote set-url origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git + env: + GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }} - name: Deploy to Sonatype staging env: @@ -67,7 +69,9 @@ jobs: - name: Push tag run: | - git push origin "v${{ github.event.inputs.version }}" + git push origin "v${GITHUB_EVENT_INPUTS_VERSION}" + env: + GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }} - name: Add Artifacts to Release Entry uses: softprops/action-gh-release@v0.1.14