Skip to content

[Artifacts] Improve get-started guide for Workers#30352

Open
dinasaur404 wants to merge 3 commits intoproductionfrom
artifacts-docs
Open

[Artifacts] Improve get-started guide for Workers#30352
dinasaur404 wants to merge 3 commits intoproductionfrom
artifacts-docs

Conversation

@dinasaur404
Copy link
Copy Markdown
Contributor

@dinasaur404 dinasaur404 commented Apr 27, 2026

Improves the Artifacts get-started guide for Workers with clearer explanations and better error handling.

Changes:

  • Added try/catch error handling in the Worker code to return 409 Conflict when a repo name already exists
  • Improved explanation of what the Worker returns (remote URL, token, and name)
  • Added bullet points clarifying the purpose of each returned field
  • Added explicit step to switch back to Worker directory before deployment
  • Clarified how the token expiry works (Unix timestamp in the query string)
  • Improved instructions for using the token with Git (header-based auth keeps token out of shell history and Git config)
  • Fixed code indentation to use tabs per codebase style

Open in Devin Review

@github-actions
Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/artifacts/ @elithrar, @dmmulroy, @mattzcarey, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/product-owners

- Add try/catch error handling for repo creation with 409 conflict response
- Clarify returned values and their purposes
- Add bullet points explaining name and token fields
- Add step to switch to Worker directory before deploy
- Improve explanations throughout the guide
devin-ai-integration[bot]

This comment was marked as resolved.

dinasaur404 and others added 2 commits April 27, 2026 12:42
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

} catch (err) {
// Return an error if the repo name is already taken.
const message = err instanceof Error ? err.message : String(err);
const status = message.includes("already exists") ? 409 : 500;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dmmulroy this should be a typed error for a 409 (exists) vs. generic server error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants