Skip to content

Commit fbcaf64

Browse files
authored
Use strict versions in package.json and align CI (#420)
With `^` it means that we can get any version up to the latest minor or patch version. For example "prettier": "^2.8.3" it means at least 2.8.3 but anything before to 3.0.0, with this change we get the exact same version all the time. The CI now reads package.json to get the same version of prettier to run.
1 parent e4b6446 commit fbcaf64

File tree

3 files changed

+169
-1174
lines changed

3 files changed

+169
-1174
lines changed

.github/workflows/lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,19 @@ jobs:
4444
steps:
4545
- name: Checkout Repository
4646
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v2.5.0
47+
- name: Get Prettier version
48+
id: prettier-version
49+
run: |
50+
echo "version=$(jq -r .devDependencies.prettier ${{ github.workspace }}/internal/nginx/modules/package.json)" >> $GITHUB_OUTPUT
4751
- name: Run Prettier on NJS code
4852
id: prettier-run
4953
uses: rutajdash/prettier-cli-action@30325c923a7b131ab8b6c99e0aff38afaddb9643 # v1.0.0
5054
with:
5155
config_path: ${{ github.workspace }}/internal/nginx/modules/.prettierrc
5256
file_pattern: ${{ github.workspace }}/internal/nginx/modules/**/*.js
53-
prettier_version: 2.6.2
57+
prettier_version: ${{ steps.prettier-version.outputs.version }}
5458
- name: Prettier Output
55-
if: ${{ failure() }}
59+
if: failure()
5660
shell: bash
5761
run: |
5862
echo "The following files are not formatted:"

0 commit comments

Comments
 (0)