-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8925f44
commit cc8b9d9
Showing
13 changed files
with
169 additions
and
16 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
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,46 @@ | ||
name: Publish docs to GitHub Pages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
destination_dir: | ||
type: string | ||
ref: | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
publish-docs-to-gh-pages: | ||
name: Publish docs to GitHub Pages | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
submodules: true | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Configure Npm | ||
run: | | ||
npm config set @codefi:registry ${{ env.NPM_PRIVATE_REGISTRY_URL }} | ||
npm config set ${{ env.NPM_PRIVATE_REGISTRY_URL }}:_authToken=${{ env.NPM_PRIVATE_REGISTRY_TOKEN }} | ||
env: | ||
NPM_PRIVATE_REGISTRY_URL: ${{ secrets.NPM_PRIVATE_REGISTRY_URL }} | ||
NPM_PRIVATE_REGISTRY_TOKEN: ${{ secrets.NPM_PRIVATE_REGISTRY_TOKEN }} | ||
- name: Install npm dependencies | ||
run: yarn --immutable | ||
- name: Run build script | ||
run: DEST="/${{ inputs.destination_dir }}" yarn build | ||
- name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch | ||
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build | ||
destination_dir: ${{ inputs.destination_dir }} | ||
keep_files: true |
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,23 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
--- | ||
name: 'Dependency Review' | ||
|
||
inputs: | ||
GITHUB_TOKEN: | ||
description: 'Github secret Token' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout tools repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Consensys/docs-gha | ||
path: .docs-gha | ||
|
||
- name: Dependency Review | ||
uses: actions/dependency-review-action@v4 | ||
with: | ||
fail-on-severity: high | ||
deny-licenses: LGPL-2.0, BSD-2-Clause |
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,52 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
--- | ||
name: 'MetaMask Security Code Scanner' | ||
description: 'MetaMask Security Code Scanner' | ||
|
||
inputs: | ||
GITHUB_TOKEN: | ||
description: 'Github secret Token' | ||
required: true | ||
SECURITY_SCAN_METRICS_TOKEN: | ||
description: 'Metrics token' | ||
required: true | ||
APPSEC_BOT_SLACK_WEBHOOK: | ||
description: 'Slack webhook' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout tools repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Consensys/docs-gha | ||
path: .docs-gha | ||
|
||
- name: MetaMask Security Code Scanner | ||
uses: MetaMask/Security-Code-Scanner@main | ||
with: | ||
repo: ${{ github.repository }} | ||
paths_ignored: | | ||
.storybook/ | ||
'**/__snapshots__/' | ||
'**/*.snap' | ||
'**/*.stories.js' | ||
'**/*.stories.tsx' | ||
'**/*.test.browser.ts*' | ||
'**/*.test.js*' | ||
'**/*.test.ts*' | ||
'**/fixtures/' | ||
'**/jest.config.js' | ||
'**/jest.environment.js' | ||
'**/mocks/' | ||
'**/test*/' | ||
docs/ | ||
e2e/ | ||
merged-packages/ | ||
node_modules | ||
storybook/ | ||
test*/ | ||
rules_excluded: example | ||
project_metrics_token: ${{ inputs.SECURITY_SCAN_METRICS_TOKEN }} | ||
slack_webhook: ${{ inputs.APPSEC_BOT_SLACK_WEBHOOK }} |
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
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,32 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
--- | ||
name: 'Trivy' | ||
description: 'Composite action to run trivy on the npm package.json' | ||
|
||
inputs: | ||
GITHUB_TOKEN: | ||
description: 'Github secret Token' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout tools repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Consensys/docs-gha | ||
path: .docs-gha | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |