Skip to content

Commit 4e2964c

Browse files
committed
ci: error message if token expired
1 parent 9403f05 commit 4e2964c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/release_github.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ jobs:
3232
echo "Releasing from main or dev branch is not permitted, please select a valid release branch."
3333
exit 1
3434
35+
- name: Check GitHub Token Validity
36+
run: |
37+
echo "-- Validating GitHub Token"
38+
status_code=$(curl -o /dev/null -s -w "%{http_code}" -H "Authorization: token ${{ secrets.GH_RELEASE }}" https://api.github.com/user)
39+
if [ "$status_code" -ne 200 ]; then
40+
echo "Error: GitHub token is invalid or expired. Please update your token in secrets."
41+
echo "Instructions can be found at: https://github.com/DeepRank/deeprank2/blob/main/README.dev.md#updating-the-token"
42+
exit 1
43+
else
44+
echo "GitHub token is valid."
45+
fi
46+
3547
- name: Checkout repository
3648
uses: actions/checkout@v4
3749
with:

0 commit comments

Comments
 (0)