Skip to content

Commit 82dfc67

Browse files
authored
fix: compile versions workflow (#269)
<!-- Thank you for proposing a pull request! Please note that SOME TESTS WILL LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from forks. Someone from the team will review your Pull Request and respond. Please describe your change and any implementation details below. -->
1 parent 2d43cee commit 82dfc67

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/compile-versions.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ jobs:
2323
with:
2424
go-version-file: 'go.mod'
2525

26+
# This ensures the remote branch is check out or a new local branch is created.
27+
# This allows us to diff against existing changes to prevet uneccessary PR updates.
28+
- name: 'Setup git'
29+
run: |-
30+
git config user.name "google-github-actions-bot"
31+
git config user.email "github-actions-bot@google.com"
32+
33+
# fetch the PR branch and switch to it, if it doesnt exist a new local branch is created
34+
git fetch origin "${{ env.PR_BRANCH }}" && git switch -c "${{ env.PR_BRANCH }}"
35+
2636
- name: 'Get versions list'
2737
run: |-
2838
mkdir -p ./data
@@ -41,10 +51,6 @@ jobs:
4151
4252
echo "had_changes=true" >> ${GITHUB_OUTPUT}
4353
44-
git config user.name "google-github-actions-bot"
45-
git config user.email "github-actions-bot@google.com"
46-
47-
git checkout -b "${{ env.PR_BRANCH }}"
4854
git add ./data/versions.json
4955
git commit -m "Update gcloud versions ($(date --iso-8601=h))"
5056
git push -f origin "${{ env.PR_BRANCH }}"

data/versions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,5 @@
435435
"481.0.0",
436436
"482.0.0",
437437
"483.0.0",
438-
"484.0.0",
439-
"485.0.0"
438+
"484.0.0"
440439
]

0 commit comments

Comments
 (0)