diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 7663f1f..1d18b7e 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -16,20 +16,26 @@ jobs: steps: - name: Notify Start + env: + COMMIT_MSG: ${{ github.event.head_commit.message }} + RUN_NUMBER: ${{ github.run_number }} + NTFY_AUTH: ${{ secrets.NTFY_AUTH }} run: | - MSG=$(echo "${{ github.event.head_commit.message }}" | head -1) + MSG=$(printf '%s\n' "$COMMIT_MSG" | head -1) wget -q -O- \ - --header="Authorization: ${{ secrets.NTFY_AUTH }}" \ + --header="Authorization: $NTFY_AUTH" \ --header="Title: Mahnung Deploy gestartet" \ --header="Priority: default" \ --header="Tags: hammer_and_wrench,envelope_with_arrow" \ - --post-data="Deploy #${{ github.run_number }}: ${MSG}" \ + --post-data="Deploy #$RUN_NUMBER: $MSG" \ "$NTFY_URL" || true - name: Checkout + env: + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} run: | - git clone --depth 1 --branch "${GITHUB_REF_NAME}" \ - "https://token:${{ secrets.GIT_TOKEN }}@git.data-it-solution.de/${GITHUB_REPOSITORY}.git" . + git clone --depth 1 --branch "$GITHUB_REF_NAME" \ + "https://token:$GIT_TOKEN@git.data-it-solution.de/$GITHUB_REPOSITORY.git" . - name: Deploy nach Dolibarr run: | @@ -59,23 +65,29 @@ jobs: - name: Notify Success if: success() + env: + RUN_NUMBER: ${{ github.run_number }} + NTFY_AUTH: ${{ secrets.NTFY_AUTH }} run: | wget -q -O- \ - --header="Authorization: ${{ secrets.NTFY_AUTH }}" \ + --header="Authorization: $NTFY_AUTH" \ --header="Title: Mahnung Deploy erfolgreich" \ --header="Priority: high" \ --header="Tags: white_check_mark,envelope_with_arrow" \ - --post-data="Deploy #${{ github.run_number }} abgeschlossen." \ + --post-data="Deploy #$RUN_NUMBER abgeschlossen." \ "$NTFY_URL" || true - name: Notify Failure if: failure() + env: + RUN_NUMBER: ${{ github.run_number }} + NTFY_AUTH: ${{ secrets.NTFY_AUTH }} run: | wget -q -O- \ - --header="Authorization: ${{ secrets.NTFY_AUTH }}" \ + --header="Authorization: $NTFY_AUTH" \ --header="Title: Mahnung Deploy FEHLGESCHLAGEN" \ --header="Priority: urgent" \ --header="Tags: x,rotating_light,envelope_with_arrow" \ - --header="Click: https://git.data-it-solution.de/${GITHUB_REPOSITORY}/actions" \ - --post-data="Deploy #${{ github.run_number }} hat einen Fehler." \ + --header="Click: https://git.data-it-solution.de/$GITHUB_REPOSITORY/actions" \ + --post-data="Deploy #$RUN_NUMBER hat einen Fehler." \ "$NTFY_URL" || true