Skip to content

Commit 9bf1eb5

Browse files
authored
ci: use GitHub token in create_additional_release_tag push (googleapis#13966)
This action failed on the [most recent full release](https://github.com/googleapis/google-cloud-java/actions/runs/30555188755) and the [most recent partial release](https://github.com/googleapis/google-cloud-java/actions/runs/29455621433); I suspect it's been broken since [persist-credentials was set to false](https://github.com/googleapis/google-cloud-java/pull/13615/changes#diff-afd3aebecfb843cab8470e95bd7903c6ae60b8072027fc03c6f462f34c7628a3). Also add ability to specify the ref to check out (e.g. release tag) to make it easier to run this manually when automation fails.
1 parent bfd98cf commit 9bf1eb5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/create_additional_release_tag.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
release:
88
types: [published]
99
workflow_dispatch:
10+
inputs:
11+
target_ref:
12+
description: 'Git ref (tag or SHA) to check out and tag. Defaults to branch HEAD if empty.'
13+
required: false
14+
default: ''
1015
jobs:
1116
build:
1217
runs-on: ubuntu-latest
@@ -18,6 +23,7 @@ jobs:
1823
- name: Checkout code
1924
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2025
with:
26+
ref: ${{ inputs.target_ref || github.ref }}
2127
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
2228
persist-credentials: false
2329
- name: Set up Git
@@ -38,7 +44,7 @@ jobs:
3844
continue
3945
fi
4046
git tag $TAG_NAME
41-
git push origin $TAG_NAME
47+
git push https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git $TAG_NAME
4248
if [ "${ARTIFACT_ID}" = "libraries-bom" ]; then
4349
echo "Creating GitHub Release for ${TAG_NAME}"
4450
gh release create "${TAG_NAME}" --title "GCP Libraries BOM ${VERSION}" --notes "libraries-bom release."

0 commit comments

Comments
 (0)