Skip to content

chore: don't persist git credentials on checkout in release workflow - #16248

Merged
teemingc merged 1 commit into
sveltejs:mainfrom
Andarist:patch-1
Jul 6, 2026
Merged

chore: don't persist git credentials on checkout in release workflow#16248
teemingc merged 1 commit into
sveltejs:mainfrom
Andarist:patch-1

Conversation

@Andarist

@Andarist Andarist commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I'm a Changesets maintainer. @teemingc reported issues with your publishing workflow (see a failed run here).

I think this is caused by changesets/action#670 . I have not anticipated this to clash with the default persist-credentials: true of actions/checkout.

While I need to fix this in changesets/action, I think there is no strong reason for you to persist this git credential here - so to unblock you sooner, I'm proposing this patch


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 6, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 2a4a8dc:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2a4a8dce5bf2b0b28f628a127b31201af768a584

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16248

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2a4a8dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

driveby change: Changesets nowadays should auto-deepen a shallow clone

Comment on lines -47 to -48
env:
NPM_CONFIG_PROVENANCE: true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

driveby change: from what I understand, this really shouldn't be required anymore (it might have been in the past). We publish Changesets itself with provenance just fine and we don't need to specify any such environment variable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Andarist are you sure? This is set so that our packages are published with provenance -- it doesn't have anything to do with whether changesets is published with provenance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh wait. I totally misread your comment. I understand now. 😆

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This the default if you use trusted publishing i believe, which is why it isn't required.

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The env: NPM_CONFIG_PROVENANCE: true block was removed from the changesets publish step, disabling npm provenance attestation on published packages.

Fix on Vercel

with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removal of fetch-depth: 0 from the release workflow checkout breaks Changesets changelog generation because it no longer has full git history.

Fix on Vercel

@teemingc teemingc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Let's give it a shot

@teemingc
teemingc merged commit de0998a into sveltejs:main Jul 6, 2026
42 of 44 checks passed
Rich-Harris pushed a commit that referenced this pull request Jul 16, 2026
Adds `persist-credentials: false` to the 13 read-only checkouts in
`ci.yml`, `audit.yml` and the platform test workflows, so the workflow
token is no longer written into `.git/config` where every later step can
read it. None of these jobs run an authenticated git operation after
checkout. #16248 already covered the release workflow.

In #15876's review, ghostdevv [suggested these exact
additions](#15876 (comment))
and elliott [planned to check on them in a
follow-up](#15876 (comment)).
This does the mechanical half of that so it doesn't get lost. If it
makes more sense folded into a bigger hardening pass, feel free to close
this one.

With this change, zizmor's `artipacked` audit flags only
`autofix-lint.yml`, which keeps its credentials because it pushes a
commit. The `secrets: inherit` part of #15529 is deliberately left
untouched.

Addresses the `persist-credentials` half of #15529.
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.

4 participants