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: add overall prettier check to ci #1399

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ jobs:
# https://github.com/actions/runner/blob/main/src/Misc/externals.sh
node-version: 20.18.0
- run: npm ci
- run: npm run format
- run: npm run build
- run: npm run lint
# Core action code
- run: npm run format # Prettier formats core action code
- run: npm run build # builds core action code into dist/
# All repo
- run: npm run lint # ESLint
- run: npm run format:all:check # Prettier formatting check

release:
runs-on: ubuntu-24.04
Expand Down
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ To contribute changes, follow these instructions in the order given below:
1. Clone the repository
1. Create a new branch with a meaningful name e.g. `fix/my-bug` based on the current `master` branch.
1. Make the necessary source code changes, including additions or changes to the [README.md](./README.md) documentation if parameters are added or affected.
1. Execute the following in the root directory of the cloned repository
1. Execute the following in the root directory of the cloned repository to install dependencies, then to format and build the action from the main source code elements (see above):

```bash
npm install
npm run format
npm run build
```

1. If you have modified any Markdown documents (`*.md`) then execute
1. If you have modified any other files, such as examples, then execute:

```bash
npm run format:all
```

1. If you have only modified Markdown documents (`*.md`), then you can alternatively execute the following to format only those documents:

```bash
npm run format:markdown
```

1. Commit the change. (If you are working on Microsoft Windows, see [Windows users](#windows-users) below.)
1. Commit any changes. (If you are working on Microsoft Windows, see [Windows users](#windows-users) below.)
1. Push to the repository.
1. If you are working in a fork, ensure actions are enabled.
1. Refer to [Manually running a workflow](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) to use this to test any particular workflow affected by your change.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"format": "prettier --write index.js src/ping.js action.yml",
"format:markdown": "prettier --write \"**/*.md\"",
"format:markdown:check": "prettier --check \"**/*.md\"",
"format:all": "prettier --write .",
"format:all:check": "prettier --check .",
"lint": "eslint",
"check:markdown-links": "find *.md docs/*.md -print0 | xargs -0 -n1 markdown-link-check",
"update:cypress": "./scripts/update-cypress-latest.sh",
Expand Down