-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #785 from myrotvorets/harden-workflows
Harden workflows
- Loading branch information
Showing
10 changed files
with
287 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Audit Signatures | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
audit: | ||
name: Verify Signatures and Provenance Statements | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
with: | ||
disable-sudo: true | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
nodejs.org:443 | ||
registry.npmjs.org:443 | ||
tuf-repo-cdn.sigstore.dev:443 | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Install latest npm | ||
run: npm install -g npm@latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run audit | ||
run: npm audit signatures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
NPM_CONFIG_FUND: '0' | ||
NPM_CONFIG_AUDIT: '0' | ||
SUPPRESS_SUPPORT: '1' | ||
NO_UPDATE_NOTIFIER: 'true' | ||
|
||
jobs: | ||
lint: | ||
name: ESLint Check | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
nodejs.org:443 | ||
registry.npmjs.org:443 | ||
- name: Run code style check | ||
uses: myrotvorets/composite-actions/node-run-script@931ae3fec4810f7d263d28f6cf12159080b76208 | ||
with: | ||
script: lint | ||
|
||
typecheck: | ||
name: TypeScript Check | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
nodejs.org:443 | ||
registry.npmjs.org:443 | ||
- name: Run type check | ||
uses: myrotvorets/composite-actions/node-run-script@931ae3fec4810f7d263d28f6cf12159080b76208 | ||
with: | ||
script: typecheck |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Publish Package | ||
|
||
on: | ||
release: | ||
types: | ||
- released | ||
workflow_dispatch: | ||
inputs: | ||
gpr: | ||
default: "yes" | ||
description: Publish to GPR? | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
prepare: | ||
name: Prepare source code | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
if: github.event_name == 'release' || github.event.inputs.gpr == 'yes' | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
nodejs.org:443 | ||
registry.npmjs.org:443 | ||
- name: Prepare source | ||
uses: myrotvorets/composite-actions/node-prepublish@931ae3fec4810f7d263d28f6cf12159080b76208 | ||
|
||
publish: | ||
name: Publish package (${{ matrix.registry }}) | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
permissions: | ||
contents: read | ||
packages: write | ||
statuses: write | ||
id-token: write | ||
strategy: | ||
matrix: | ||
registry: | ||
- gpr | ||
include: | ||
- registry: gpr | ||
secret: GITHUB_TOKEN | ||
registry_url: https://npm.pkg.github.com/ | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
fulcio.sigstore.dev:443 | ||
rekor.sigstore.dev:443 | ||
npm.pkg.github.com:443 | ||
- name: Publish package | ||
uses: myrotvorets/composite-actions/node-publish@931ae3fec4810f7d263d28f6cf12159080b76208 | ||
with: | ||
node-auth-token: ${{ secrets[matrix.secret] }} | ||
registry-url: ${{ matrix.registry_url }} | ||
if: github.event.inputs[matrix.registry] == 'yes' || github.event_name == 'release' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.