diff --git a/.gitea/workflows/build-script.yaml b/.gitea/workflows/build-script.yaml index d0446a4..a1bcc77 100644 --- a/.gitea/workflows/build-script.yaml +++ b/.gitea/workflows/build-script.yaml @@ -17,7 +17,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 2 submodules: false lfs: false @@ -56,14 +55,24 @@ jobs: tag_name: "latest" files: build/*.pdf - - name: Remove old 'latest' tag and push new one - continue-on-error: true - run: git tag -d latest && git push origin :refs/tags/latest - - - name: Create 'latest' tag and push it - continue-on-error: true - run: git tag latest HEAD && git push origin latest + - name: Update and push latest tag + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -euo pipefail + git config user.name "gitea-actions" + git config user.email "actions@local" + + # Ensure origin uses token auth + git remote set-url origin "https://oauth2:${GITEA_TOKEN}@gitea.mintcalc.com/alexander/TUM-Formelsammlungen.git" + + # Move (or create) the tag locally + git tag -f latest + + # Force-push the tag to overwrite remote 'latest' + git push origin refs/tags/latest --force + - name: Trigger continue-on-error: true run: curl -u trigger:${{ secrets.TRIGGER_PASSWORD }} -X POST https://trigger.typst4ei.de/trigger/all \ No newline at end of file