Skip to content

Commit f1d7e52

Browse files
[Infra] Improve error message for expired PAT in release workflows (#15070)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 453699b commit f1d7e52

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/prerelease.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,20 @@ jobs:
6161
git add .
6262
# commit without diff will throw an error. `git diff --exit-code` can avoid such error.
6363
git diff --staged --exit-code || git commit -m "Empty spec repo."
64-
git push
64+
# Attempt to push. If it fails, print a detailed error message and exit.
65+
git push || {
66+
echo "--------------------------------------------------------------------------------"
67+
echo "ERROR: Failed to push to Firebase/SpecsTesting."
68+
echo "This is likely due to an expired Personal Access Token (PAT)."
69+
echo "Please take the following steps to resolve this:"
70+
echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsTesting repo."
71+
echo " This can be done in the OSS bot's GitHub account settings. Ensure the token "
72+
echo " has the 'public_repo' scope."
73+
echo "2. Update the 'PRERELEASE_TESTING_PAT' secret in this repo's settings."
74+
echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)"
75+
echo "--------------------------------------------------------------------------------"
76+
exit 1
77+
}
6578
- name: Clean Artifacts
6679
if: ${{ always() }}
6780
run: |

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,20 @@ jobs:
5858
git add .
5959
# commit without diff will throw an error. `git diff --exit-code` can avoid such error.
6060
git diff --staged --exit-code || git commit -m "Empty spec repo."
61-
git push
61+
# Attempt to push. If it fails, print a detailed error message and exit.
62+
git push || {
63+
echo "--------------------------------------------------------------------------------"
64+
echo "ERROR: Failed to push to Firebase/SpecsReleasing."
65+
echo "This is likely due to an expired Personal Access Token (PAT)."
66+
echo "Please take the following steps to resolve this:"
67+
echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsReleasing repo."
68+
echo " This can be done in the OSS bot's GitHub account settings. Ensure the token "
69+
echo " has the 'public_repo' scope."
70+
echo "2. Update the 'RELEASE_TESTING_PAT' secret in this repo's settings."
71+
echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)"
72+
echo "--------------------------------------------------------------------------------"
73+
exit 1
74+
}
6275
- name: Clean Artifacts
6376
if: ${{ always() }}
6477
run: |

0 commit comments

Comments
 (0)