diff --git a/.github/workflows/worker.yml b/.github/workflows/worker.yml index 3af5d4c3..8274b21d 100644 --- a/.github/workflows/worker.yml +++ b/.github/workflows/worker.yml @@ -88,11 +88,22 @@ jobs: args=$(mise run worker:wrangler-args) echo "args=${args}" >> "${GITHUB_OUTPUT}" - - name: Deploy to Cloudflare workers with Wrangler + - name: Get Commit SHA and Message + id: commit + run: | + sha=${{ github.event.pull_request.head.sha || github.sha }} + message=$(git log --format=%B --max-count=1 $sha) + echo "message=${message}" >> "${GITHUB_OUTPUT}" + + - name: Upload a Version of Cloudflare Workers with Wrangler + id: deploy uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0 with: workingDirectory: worker - command: versions upload ${{ steps.wrangler-args.outputs.args }} + command: >- + versions upload --tag ${{ steps.commit.outputs.sha }} + --message ${{ steps.commit.outputs.message }} + ${{ steps.wrangler-args.outputs.args }} apiToken: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }} accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}