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

fix: changeset PR update not running workflows #1848

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Mar 9, 2024

The FuelLabs/changesets-action@main action is supposed to trigger workflows in the changesets branch after it force-pushes commits because it's given the REPO_TOKEN - which is a personal access token (PAT) of our fuel-service-user - but the workflows aren't being run because apparently the GITHUB_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 (via persist-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 the GITHUB_TOKEN into git's local config and actions/toolkit which FuelLabs/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.

@nedsalk nedsalk self-assigned this Mar 9, 2024
@nedsalk nedsalk added the bug Issue is a bug label Mar 9, 2024
Copy link
Contributor

github-actions bot commented Mar 9, 2024

Coverage Report:

Lines Branches Functions Statements
79.48%(+0%) 70.29%(+0%) 78.04%(+0%) 79.57%(+0%)
Changed Files:

Coverage values did not change👌.

@nedsalk nedsalk marked this pull request as ready for review March 9, 2024 10:23
Copy link
Member

@Dhaiwat10 Dhaiwat10 left a comment

Choose a reason for hiding this comment

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

Nice one @nedsalk, might be a good idea to file a follow-up issue to disable persisting credentials for all workflows

Copy link
Member

@danielbate danielbate left a comment

Choose a reason for hiding this comment

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

Nice one, hopefully this does the trick, more CI testing fun.

Copy link
Member

@arboleya arboleya left a comment

Choose a reason for hiding this comment

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

Nice find! 🎯

@nedsalk nedsalk merged commit fb5da8a into master Mar 11, 2024
18 of 19 checks passed
@nedsalk nedsalk deleted the ns/fix/changeset-automation-PR branch March 11, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix changeset automation PR
4 participants