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

ci(workflows): enable prettier for forks #675

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

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Feb 9, 2024

Resolves #674


Before the change?

  • Error: GITHUB_TOKEN is not configured. Make sure you made it available to your action

After the change?

  • Prettier works in forks (and could work in this repository)

Note: The configuration has a PAT... There are a whole bunch of ways to make this work, but this seems simplest... One could just remove the PAT, or I could add some really complicated code to check to see if there is a PAT and if there is a PAT do one thing and then if not, do the other... But, I don't see the point.

I'm also upgrading the node version to 20 since this package.json is 20 and it seems like a bad idea to run linters w/ the wrong version of node -- the prettier workflow is disabled in this repository and I wonder if that's one of the reasons it is...

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Copy link

github-actions bot commented Feb 9, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@jsoref
Copy link
Contributor Author

jsoref commented Feb 9, 2024

Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Nice hack 👍🏼

For what it's worth, for new repositories, I just run prettier on push to the default branch. I use a dedicated GItHub App for that purpose and define the app in the bypass list for the new repository rules so that it push to the default branch directly. That way we can remove all format related CI/friction, it just happens automagically in the background. Happy to help set that up across @octokit. I meant to write about how it works for a long time now anyway

I'll let the @octokit/maintainers decide what they want to do

@jsoref
Copy link
Contributor Author

jsoref commented Feb 11, 2024

There's an even fancier hack that would involve a reusable workflow and two jobs that would call it with the available item. But I'm not an expert in using reusable workflows. If this workflow was a lot more complicated, that'd probably be warranted.

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

Successfully merging this pull request may close these issues.

[BUG]: prettier doesn't work on forks
2 participants