diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 3857d71..d9a214c 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -64,7 +64,7 @@ jobs: - name: Create new tag env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | new_tag=${{ steps.get_latest_tag.outputs.version }} git config --global user.name 'github-actions[bot]' @@ -90,13 +90,27 @@ jobs: echo "---" echo "Direct version value: ${{ steps.get_latest_tag.outputs.version }}" + - name: Debug Release Trigger + run: | + echo "Auto-tag completed successfully" + echo "Version to be released: ${{ steps.get_latest_tag.outputs.version }}" + echo "Checking release conditions:" + echo " - Version not empty: ${{ steps.get_latest_tag.outputs.version != '' }}" + echo " - Current job status: ${{ job.status }}" + release: needs: auto-tag + permissions: + contents: write + packages: write + actions: write if: | - always() && needs.auto-tag.result == 'success' && needs.auto-tag.outputs.version != '' uses: ./.github/workflows/release.yml with: version: ${{ needs.auto-tag.outputs.version }} - secrets: inherit + secrets: + RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ba69df..5a346ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,10 @@ on: tags: - "v*" -permissions: write-all +permissions: + contents: write + packages: write + actions: write jobs: goreleaser: @@ -29,6 +32,23 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 15 steps: + - name: Check Permissions + run: | + echo "Checking required permissions..." + TOKEN="${{ secrets.RELEASE_TOKEN }}" + if [ -z "$TOKEN" ]; then + echo "::error::RELEASE_TOKEN is not set" + exit 1 + fi + echo "Token permissions check passed" + + - name: Debug Workflow Trigger + run: | + echo "Event name: ${{ github.event_name }}" + echo "Ref: ${{ github.ref }}" + echo "Version input: ${{ inputs.version }}" + echo "Token exists: ${{ secrets.RELEASE_TOKEN != '' }}" + - name: Checkout uses: actions/checkout@v3 with: