|
3 | 3 | workflow_call:
|
4 | 4 | inputs:
|
5 | 5 | homebrew:
|
6 |
| - description: 'Boolean to opt-out of releasing to homebrew.' |
| 6 | + description: "Boolean to opt-out of releasing to homebrew." |
7 | 7 | default: true
|
8 | 8 | required: false
|
9 | 9 | type: boolean
|
10 | 10 | 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." |
12 | 12 | default: nodenv
|
13 | 13 | required: false
|
14 | 14 | type: string
|
15 | 15 | 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 |
18 | 18 |
|
19 |
| -permissions: {contents: read} |
| 19 | +permissions: { contents: read } |
20 | 20 |
|
21 | 21 | jobs:
|
22 | 22 | github:
|
23 |
| - permissions: {contents: write} |
| 23 | + permissions: { contents: write } |
24 | 24 | runs-on: ubuntu-latest
|
25 | 25 | 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 }} |
35 | 35 |
|
36 | 36 | homebrew:
|
37 | 37 | if: inputs.homebrew && !contains(github.ref, '-') # skip prereleases
|
38 |
| - permissions: {contents: read} |
| 38 | + permissions: { contents: read } |
39 | 39 | runs-on: ubuntu-latest
|
40 | 40 | 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 }} |
50 | 50 |
|
51 | 51 | major-tag:
|
52 | 52 | if: ${{ !contains(github.ref, '-') }} # skip prereleases
|
53 |
| - permissions: {contents: write} |
| 53 | + permissions: { contents: write } |
54 | 54 | runs-on: ubuntu-latest
|
55 | 55 | 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%%.*}" |
60 | 60 |
|
61 | 61 | npm:
|
62 |
| - permissions: {id-token: write} |
| 62 | + permissions: { id-token: write } |
63 | 63 | runs-on: ubuntu-latest
|
64 | 64 | 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 }} |
0 commit comments