Skip to content

Commit b9c5cf6

Browse files
authored
Merge pull request #73 from nodenv/prettier
Reformat using prettier
2 parents 1b778b8 + ae1f643 commit b9c5cf6

14 files changed

+121
-116
lines changed

.github/workflows/_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Test
22
on:
33
pull_request:
4-
push: {branches: main}
5-
schedule: [{cron: '0 0 10 * *'}] # monthly https://crontab.guru/#0_0_10_*_*
4+
push: { branches: main }
5+
schedule: [{ cron: "0 0 10 * *" }] # monthly https://crontab.guru/#0_0_10_*_*
66
workflow_dispatch:
77
permissions: {}
88

99
jobs:
1010
test:
1111
uses: ./.github/workflows/test.yml
12-
with: {npm: false}
12+
with: { npm: false }
1313
permissions:
1414
contents: read
1515
packages: read

.github/workflows/release.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,72 @@ on:
33
workflow_call:
44
inputs:
55
homebrew:
6-
description: 'Boolean to opt-out of releasing to homebrew.'
6+
description: "Boolean to opt-out of releasing to homebrew."
77
default: true
88
required: false
99
type: boolean
1010
npm_scope: # FIXME until setup-node infers scope from package.json
11-
description: 'Name of scope to publish package under.'
11+
description: "Name of scope to publish package under."
1212
default: nodenv
1313
required: false
1414
type: string
1515
secrets:
16-
NPMJS_TOKEN: {required: true} # required for npm job
17-
BOT_TOKEN: {required: false} # required for homebrew job
16+
NPMJS_TOKEN: { required: true } # required for npm job
17+
BOT_TOKEN: { required: false } # required for homebrew job
1818

19-
permissions: {contents: read}
19+
permissions: { contents: read }
2020

2121
jobs:
2222
github:
23-
permissions: {contents: write}
23+
permissions: { contents: write }
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
27-
with: {egress-policy: audit}
28-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29-
- run: |
30-
# shellcheck disable=SC2086
31-
gh release create ${tag/*-*/"$tag" --prerelease} --generate-notes
32-
env:
33-
GH_TOKEN: ${{ github.token }}
34-
tag: ${{ github.ref_name }}
26+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
27+
with: { egress-policy: audit }
28+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29+
- run: |
30+
# shellcheck disable=SC2086
31+
gh release create ${tag/*-*/"$tag" --prerelease} --generate-notes
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
tag: ${{ github.ref_name }}
3535
3636
homebrew:
3737
if: inputs.homebrew && !contains(github.ref, '-') # skip prereleases
38-
permissions: {contents: read}
38+
permissions: { contents: read }
3939
runs-on: ubuntu-latest
4040
steps:
41-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
42-
with: {egress-policy: audit}
43-
- uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1
44-
with:
45-
homebrew-tap: ${{ contains(fromJSON('["nodenv","node-build"]'),
46-
github.event.repository.name)
47-
&& 'Homebrew/homebrew-core' || 'nodenv/homebrew-nodenv' }}
48-
env:
49-
COMMITTER_TOKEN: ${{ secrets.BOT_TOKEN }}
41+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
42+
with: { egress-policy: audit }
43+
- uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1
44+
with:
45+
homebrew-tap: ${{ contains(fromJSON('["nodenv","node-build"]'),
46+
github.event.repository.name)
47+
&& 'Homebrew/homebrew-core' || 'nodenv/homebrew-nodenv' }}
48+
env:
49+
COMMITTER_TOKEN: ${{ secrets.BOT_TOKEN }}
5050

5151
major-tag:
5252
if: ${{ !contains(github.ref, '-') }} # skip prereleases
53-
permissions: {contents: write}
53+
permissions: { contents: write }
5454
runs-on: ubuntu-latest
5555
steps:
56-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
57-
with: {egress-policy: audit}
58-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59-
- run: git push -f origin "HEAD:refs/heads/${GITHUB_REF_NAME%%.*}"
56+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
57+
with: { egress-policy: audit }
58+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59+
- run: git push -f origin "HEAD:refs/heads/${GITHUB_REF_NAME%%.*}"
6060

6161
npm:
62-
permissions: {id-token: write}
62+
permissions: { id-token: write }
6363
runs-on: ubuntu-latest
6464
steps:
65-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
66-
with: {egress-policy: audit}
67-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
69-
with: # FIXME https://github.com/actions/setup-node/pull/129
70-
scope: ${{ inputs.npm_scope }}
71-
registry-url: https://registry.npmjs.org
72-
- run: npm publish --provenance
73-
env:
74-
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
65+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
66+
with: { egress-policy: audit }
67+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
69+
with: # FIXME https://github.com/actions/setup-node/pull/129
70+
scope: ${{ inputs.npm_scope }}
71+
registry-url: https://registry.npmjs.org
72+
- run: npm publish --provenance
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}

.github/workflows/sync-default-branch.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ permissions: {}
55
jobs:
66
default-branch:
77
if: github.ref_name == github.event.repository.default_branch
8-
permissions: {contents: write}
8+
permissions: { contents: write }
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
12-
with: {egress-policy: audit}
13-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
14-
- run: git push --force origin HEAD:refs/heads/master
11+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
12+
with: { egress-policy: audit }
13+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
14+
- run: git push --force origin HEAD:refs/heads/master

.github/workflows/tag-major.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ permissions: {}
88
jobs:
99
major:
1010
if: github.ref_type == 'tag' && !contains(github.ref, '-') # skip prereleases
11-
permissions: {contents: write}
11+
permissions: { contents: write }
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
15-
with: {egress-policy: audit}
16-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
17-
- run: git push -f origin "HEAD:refs/heads/${GITHUB_REF_NAME%%.*}"
14+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
15+
with: { egress-policy: audit }
16+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
17+
- run: git push -f origin "HEAD:refs/heads/${GITHUB_REF_NAME%%.*}"

.github/workflows/test.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,68 @@ on:
33
workflow_call:
44
inputs:
55
npm:
6-
description: 'Run npm-cit job.'
6+
description: "Run npm-cit job."
77
default: true
88
required: false
99
type: boolean
1010
superlinter:
11-
description: 'Run super-linter job.'
11+
description: "Run super-linter job."
1212
default: true
1313
required: false
1414
type: boolean
15-
permissions: {contents: read}
15+
permissions: { contents: read }
1616

1717
jobs:
1818
npm-cit:
1919
if: inputs.npm
2020
runs-on: ${{ matrix.os }}-latest
21-
strategy: {matrix: {os: [ubuntu, macOS]}}
21+
strategy: { matrix: { os: [ubuntu, macOS] } }
2222
steps:
23-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
24-
with: {egress-policy: audit}
25-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
26-
- run: npm cit
23+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
24+
with: { egress-policy: audit }
25+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
26+
- run: npm cit
2727

2828
super-linter:
2929
if: inputs.superlinter
30-
permissions: {contents: read, packages: read, statuses: write}
30+
permissions: { contents: read, packages: read, statuses: write }
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
34-
with: {egress-policy: audit}
35-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36-
with: {fetch-depth: 0}
37-
- uses: super-linter/super-linter/slim@5b638caee6ba65e25e07143887b669a1233847a0 # v6.5.1
38-
env:
39-
GITHUB_TOKEN: ${{ github.token }}
40-
BASH_EXEC_IGNORE_LIBRARIES: true # superlinter bug
33+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
34+
with: { egress-policy: audit }
35+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
with: { fetch-depth: 0 }
37+
- uses: super-linter/super-linter/slim@5b638caee6ba65e25e07143887b669a1233847a0 # v6.5.1
38+
env:
39+
GITHUB_TOKEN: ${{ github.token }}
40+
BASH_EXEC_IGNORE_LIBRARIES: true # superlinter bug
4141

4242
dependency-review:
4343
if: startsWith('pull_request', github.event_name)
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
47-
with: {egress-policy: audit}
48-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
49-
- uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
46+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
47+
with: { egress-policy: audit }
48+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
49+
- uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
5050

5151
ossf-scorecard:
5252
if: github.ref_name == github.event.repository.default_branch
53-
permissions: {id-token: write, security-events: write}
53+
permissions: { id-token: write, security-events: write }
5454
runs-on: ubuntu-latest
5555
steps:
56-
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
57-
with: {egress-policy: audit}
58-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59-
- uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
60-
with:
61-
results_file: ossf-scorecard-results.sarif
62-
results_format: sarif
63-
publish_results: true
64-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
65-
with:
66-
name: ossf-scorecard-results.sarif
67-
path: ossf-scorecard-results.sarif
68-
- uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
69-
with:
70-
sarif_file: ossf-scorecard-results.sarif
56+
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
57+
with: { egress-policy: audit }
58+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59+
- uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
60+
with:
61+
results_file: ossf-scorecard-results.sarif
62+
results_format: sarif
63+
publish_results: true
64+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
65+
with:
66+
name: ossf-scorecard-results.sarif
67+
path: ossf-scorecard-results.sarif
68+
- uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
69+
with:
70+
sarif_file: ossf-scorecard-results.sarif

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ will fast-forward the `v2` branch to the latest 2.x tag. This way consumers of
1212
these reusable workflows may "soft-pin" to a major version and automatically
1313
get minor and patch updates. see [Contributing#releasing](/docs/CONTRIBUTING.md#releasing)
1414

15-
[nodenv organization]: https://github.com/nodenv
16-
[reusable workflows]: https://docs.github.com/en/actions/using-workflows/reusing-workflows
17-
[starter workflows]: https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization
15+
[nodenv organization]: https://github.com/nodenv
16+
[reusable workflows]: https://docs.github.com/en/actions/using-workflows/reusing-workflows
17+
[starter workflows]: https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization

docs/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Once the tag is created by the release,
1818
it will kick off the [tag-major.yml][] workflow
1919
which will bump the vN ref for downstream users to pin to.
2020

21-
[test.yml]: https://github.com/nodenv/.github/blob/main/.github/workflows/test.yml
22-
[tag-major.yml]: https://github.com/nodenv/.github/blob/main/.github/workflows/tag-major.yml
21+
[test.yml]: https://github.com/nodenv/.github/blob/main/.github/workflows/test.yml
22+
[tag-major.yml]: https://github.com/nodenv/.github/blob/main/.github/workflows/tag-major.yml

docs/SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ though it is instead recommended to pin to a specific git-sha and use [Dependabo
1212

1313
Use GitHub's [built-in reporting mechanism][gh-security].
1414

15-
[latest-release]: https://github.com/nodenv/.github/releases/latest
16-
[dependabot]: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#github-actions
17-
[gh-security]: https://github.com/nodenv/.github/security/advisories/new
15+
[latest-release]: https://github.com/nodenv/.github/releases/latest
16+
[dependabot]: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#github-actions
17+
[gh-security]: https://github.com/nodenv/.github/security/advisories/new
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "Release",
3-
"description": "Release to GitHub",
4-
"iconName": "octicon tag",
5-
"categories": [ "github", "deployment", "automation" ]
2+
"name": "Release",
3+
"description": "Release to GitHub",
4+
"iconName": "octicon tag",
5+
"categories": ["github", "deployment", "automation"]
66
}

workflow-templates/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ permissions: {}
55

66
jobs:
77
release:
8-
permissions: {contents: write, id-token: write}
8+
permissions: { contents: write, id-token: write }
99
uses: nodenv/.github/.github/workflows/release.yml@v4
1010
secrets: inherit

0 commit comments

Comments
 (0)