Skip to content

Commit 622a087

Browse files
committed
ci: add overall prettier check to ci
1 parent a84cb0a commit 622a087

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/workflows/main.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ jobs:
2020
# https://github.com/actions/runner/blob/main/src/Misc/externals.sh
2121
node-version: 20.18.0
2222
- run: npm ci
23-
- run: npm run format
24-
- run: npm run build
25-
- run: npm run lint
23+
# Core action code
24+
- run: npm run format # Prettier formats core action code
25+
- run: npm run build # builds core action code into dist/
26+
# All repo
27+
- run: npm run lint # ESLint
28+
- run: npm run format:all:check # Prettier formatting check
2629

2730
release:
2831
runs-on: ubuntu-24.04

CONTRIBUTING.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,27 @@ To contribute changes, follow these instructions in the order given below:
4343
1. Clone the repository
4444
1. Create a new branch with a meaningful name e.g. `fix/my-bug` based on the current `master` branch.
4545
1. Make the necessary source code changes, including additions or changes to the [README.md](./README.md) documentation if parameters are added or affected.
46-
1. Execute the following in the root directory of the cloned repository
46+
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):
4747

4848
```bash
4949
npm install
5050
npm run format
5151
npm run build
5252
```
5353

54-
1. If you have modified any Markdown documents (`*.md`) then execute
54+
1. If you have modified any other files, such as examples, then execute:
55+
56+
```bash
57+
npm run format:all
58+
```
59+
60+
1. If you have only modified Markdown documents (`*.md`), then you can alternatively execute the following to format only those documents:
5561

5662
```bash
5763
npm run format:markdown
5864
```
5965

60-
1. Commit the change. (If you are working on Microsoft Windows, see [Windows users](#windows-users) below.)
66+
1. Commit any changes. (If you are working on Microsoft Windows, see [Windows users](#windows-users) below.)
6167
1. Push to the repository.
6268
1. If you are working in a fork, ensure actions are enabled.
6369
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.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"format": "prettier --write index.js src/ping.js action.yml",
1616
"format:markdown": "prettier --write \"**/*.md\"",
1717
"format:markdown:check": "prettier --check \"**/*.md\"",
18+
"format:all": "prettier --write .",
19+
"format:all:check": "prettier --check .",
1820
"lint": "eslint",
1921
"check:markdown-links": "find *.md docs/*.md -print0 | xargs -0 -n1 markdown-link-check",
2022
"update:cypress": "./scripts/update-cypress-latest.sh",

0 commit comments

Comments
 (0)