Skip to content

How to add tag or message with wrangler deploy command? #387

@yusiny

Description

@yusiny

Hi, I’m deploying my Worker using wrangler-action like this:

- name: Deploy Alpha
  uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUD_FLARE_WORKER_API_TOKEN }}
    accountId: ${{ secrets.CF_ACCOUNT_ID }}
    workingDirectory: 'myWorkingDirectory'
    environment: alpha
    preCommands: echo "*** Before run deployment command ***"
    command: deploy .output/server/index.mjs --assets .output/public
    postCommands: echo "*** Post run deployment command ***"

The issue is:
wrangler deploy doesn’t provide a --tag (-t) option.

To work around this, I tried:
1. versions upload with a tag
2. deploy that uploaded version

But between (1) and (2), I have to call the Cloudflare API to get the version_id. This feels inefficient and hacky.

👉 Is there a better way to deploy with a tag directly using wrangler-action? Or any recommended pattern to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions