add secrets check to release workflow

[skip build]
This commit is contained in:
Relentless 2022-10-19 17:17:59 +02:00
parent 2a7a6444ee
commit ee3f80d572
No known key found for this signature in database
GPG key ID: 759D97B8C6F25265

View file

@ -20,6 +20,25 @@ jobs:
- name: Clone Repository
uses: actions/checkout@v3
- name: Check Secrets
run: |
if [ -z "${{ secrets.MODRINTH_TOKEN }}" ]; then
echo "MODRINTH_TOKEN is not set"
exit 1
fi
if [ -z "${{ secrets.CURSEFORGE_TOKEN }}" ]; then
echo "CURSEFORGE_TOKEN is not set"
exit 1
fi
- name: Validate Modrinth Token
run: |
curl -s -H "Authorization: ${{ secrets.MODRINTH_TOKEN }}" https://api.modrinth.com/v2/user | grep -q "unauthorized"
if [ $? -eq 0 ]; then
echo "MODRINTH_TOKEN is not valid"
exit 1
fi
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with: