From c321afdc8f99241060f1738ec636946a4916793a Mon Sep 17 00:00:00 2001 From: Risu <79110363+risu729@users.noreply.github.com> Date: Sun, 12 Jan 2025 03:09:38 +0900 Subject: [PATCH] ci(.github/workflows/worker.yml): add tag and message --- .github/workflows/worker.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 }}