Skip to content

Commit 0d10dd9

Browse files
Refactor Github Action per b/485167538 (#89)
Co-authored-by: Ben Knutson <benknutson@google.com>
1 parent a67b583 commit 0d10dd9

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/release-cherry-pick.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ jobs:
3030
3131
- name: Cherry-pick commit
3232
run: |
33-
echo "Cherry-picking ${{ inputs.commit_sha }} to release/candidate"
34-
git cherry-pick ${{ inputs.commit_sha }}
33+
echo "Cherry-picking ${INPUTS_COMMIT_SHA} to release/candidate"
34+
git cherry-pick ${INPUTS_COMMIT_SHA}
35+
env:
36+
INPUTS_COMMIT_SHA: ${{ inputs.commit_sha }}
3537

3638
- name: Push changes
3739
run: |

.github/workflows/release-finalize.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ jobs:
6868
- name: Rename release/candidate to release/v{version}
6969
if: steps.check.outputs.is_release_pr == 'true'
7070
run: |
71-
VERSION="v${{ steps.version.outputs.version }}"
71+
VERSION="v${STEPS_VERSION_OUTPUTS_VERSION}"
7272
git push origin "release/candidate:refs/heads/release/$VERSION" ":release/candidate"
7373
echo "Renamed release/candidate to release/$VERSION"
74+
env:
75+
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
7476

7577
- name: Update PR label to tagged
7678
if: steps.check.outputs.is_release_pr == 'true'

.github/workflows/release-publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
steps:
1616
- name: Validate branch
1717
run: |
18-
if [[ ! "${{ github.ref_name }}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
18+
if [[ ! "${GITHUB_REF_NAME}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1919
echo "Error: Must run from a release/v* branch (e.g., release/v0.3.0)"
2020
exit 1
2121
fi
2222
2323
- name: Extract version
2424
id: version
2525
run: |
26-
VERSION="${{ github.ref_name }}"
26+
VERSION="${GITHUB_REF_NAME}"
2727
VERSION="${VERSION#release/v}"
2828
echo "version=$VERSION" >> $GITHUB_OUTPUT
2929
echo "Publishing version: $VERSION"
@@ -51,9 +51,10 @@ jobs:
5151
- name: Create merge-back PR
5252
env:
5353
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
54+
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
5455
run: |
5556
gh pr create \
5657
--base main \
57-
--head "${{ github.ref_name }}" \
58-
--title "chore: merge release v${{ steps.version.outputs.version }} to main" \
59-
--body "Syncs version bump and CHANGELOG from release v${{ steps.version.outputs.version }} to main."
58+
--head "${GITHUB_REF_NAME}" \
59+
--title "chore: merge release v${STEPS_VERSION_OUTPUTS_VERSION} to main" \
60+
--body "Syncs version bump and CHANGELOG from release v${STEPS_VERSION_OUTPUTS_VERSION} to main."

0 commit comments

Comments
 (0)