Skip to content

Commit

Permalink
ci: error message if token expired
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBodor committed Sep 6, 2024
1 parent f9e5363 commit f8a7fbc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ jobs:
echo "Releasing from main or dev branch is not permitted, please select a valid release branch."
exit 1
- name: Check GitHub Token Validity
run: |
echo "-- Validating GitHub Token"
status_code=$(curl -o /dev/null -s -w "%{http_code}" -H "Authorization: token ${{ secrets.GH_RELEASE }}" https://api.github.com/user)
if [ "$status_code" -ne 200 ]; then
echo "Error: GitHub token is invalid or expired. Please update your token in secrets."
echo "Instructions can be found at: https://github.com/DeepRank/deeprank2/blob/main/README.dev.md#updating-the-token"
exit 1
else
echo "GitHub token is valid."
fi
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit f8a7fbc

Please sign in to comment.