Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add version-id to action output of "version upload" command #356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iiroj
Copy link

@iiroj iiroj commented Feb 15, 2025

This Pull Request adds a new GitHub Action output version-id referring to the new version uploaded with wrangler versions upload.

The use-case is to be able to run the Wrangler action to upload a new Worker version, and then run it again to deploy that version, for example:

      - name: Upload new Worker version
        id: upload
        uses: cloudflare/wrangler-action@v3
        with:
          command: versions upload --tag "${{ github.ref_name }}"
      - name: Deploy new Worker version to 100%
        uses: cloudflare/wrangler-action@v3
        with:
          command: versions deploy "${{ steps.upload.outputs.version-id }}@100%"

@iiroj iiroj requested review from a team as code owners February 15, 2025 12:14
@iiroj iiroj force-pushed the version-upload-id branch from c4b0d3b to 7209472 Compare February 15, 2025 12:15
Comment on lines +48 to +49
/** The id of this uploaded version. Format is UUID . */
version_id: z.string().optional(),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a UUID when running wrangler locally with WRANGLER_OUTPUT_FILE_DIRECTORY and looking at the output file, but I opted to simply parse it as a string because I assume it's not that important.

Copy link
Member

@Maximo-Guk Maximo-Guk Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go ahead and parse it as a UUID since it should only ever be a UUID according to https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/output.ts#L141

if the format changes from UUID, that would definitely be a breaking API change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants