fix: changeset PR update not running workflows #1848
Merged
+5
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
FuelLabs/changesets-action@main
action is supposed to trigger workflows in the changesets branch after it force-pushes commits because it's given theREPO_TOKEN
- which is a personal access token (PAT) of our fuel-service-user - but the workflows aren't being run because apparently theGITHUB_TOKEN
is still being used when the PR is updated.Upon analyzing the discussions and linked PRs in changesets/action#70, it seems that stopping
actions/checkout
from persisting credentials (viapersist-credentials: false
) should do the trick.closes #1734
Where's the bug?
The bug most probably lies somewhere in the interplay between
actions/checkout
which by default persists theGITHUB_TOKEN
into git's local config and actions/toolkit whichFuelLabs/changesets-action@main
uses to interact with GitHub.Important
It seems that the default behavior of
persist-credentials:true
is generally a security issue (actions/checkout#485). We should consider disabling it in all of our workflows.