-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add formatting as workflow (as requested) #13982
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for your second attempt at this, I highly value that!
.github/workflows/formatting.yml
Outdated
format: | ||
if: github.repository == 'is-a-dev/register' | ||
runs-on: ubuntu-latest | ||
permissions: [read-all, write-all] | ||
steps: | ||
run: npx prettier domains/* --check | ||
if github.working-directory == 'domains/': | ||
run: npx prettier domains/* --write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got something to say about this:
- push the changes. an approach to this would be to use actions/checkout.
- I don't think we need write-all, only write: contents will be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t believe we need a package-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already had a package-lock.json
file, I just updated it to include the prettier
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't one on the main branch at the moment, unless my client is bugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see one directly on https://github.com/is-a-dev/register.
I also forked the repo directly from Github, without adding the rest of the package-lock.json.
Not sure what's going on here, I'll take a proper look later when I'm at my computer.
I'm also not sure why the diff for this pr shows me as adding the entire package-lock.json - I'll also have a look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns a 404 for me. https://github.com/is-a-dev/register/blob/main/package-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you ensure this works by running it in a test repo?
Sure @wdhdev, I'll do it later on today :) |
.github/workflows/formatting.yml
Outdated
repository: '${{ github.repository }}' | ||
token: '${{ github.token }}' | ||
branches: | ||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't push, check out this part
Have you done this yet? If so, please send me the action run. |
Any updates? |
This pull request has been marked as stale due to inactivity and will be closed. Comment anything on this PR to prevent it |
@tobezdev Any updates? |
Yes. I have managed to recreate the workflow on a private test repo. The formatting seemed to work fine, but I'm trying to troubleshoot a check failure (though it seems to work fine) |
This PR is not a domain creation request.
Reference pull #13966
Version 2 of adding Prettier formatting to is-a-dev/register!
New in this version:
.github/workflows/formatting.yml
- create the workflowpackage.json
- added configuration for the formatterpackage-lock.json
- added script to run formatting on-change.prettierrc
- add configuration for formatting to run with.prettierignore
- add a list of files for formatting to ignorePlease request changes on
.prettierignore
before merging this to ensure the formatter only edits the correct files. You may also want to check/test the workflow to ensure it runs as intended.