Skip to content

Commit b39d73e

Browse files
authored
Add lint workflow (#28)
* Add lint workflow * Remove unnecessary checkout and id * Remove node-version and add .nvmrc * Update lockfile * Update changelog
1 parent c393e60 commit b39d73e

File tree

5 files changed

+65
-18
lines changed

5 files changed

+65
-18
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build, Lint, and Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
prepare:
8+
name: Prepare
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout and setup environment
12+
uses: MetaMask/action-checkout-and-setup@v1
13+
with:
14+
is-high-risk-environment: false
15+
cache-node-modules: true
16+
17+
lint:
18+
name: Lint
19+
needs: prepare
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout and setup environment
23+
uses: MetaMask/action-checkout-and-setup@v1
24+
with:
25+
is-high-risk-environment: false
26+
cache-node-modules: true
27+
- run: yarn lint
28+
- name: Validate RC changelog
29+
if: ${{ startsWith(github.head_ref, 'release/') }}
30+
run: yarn lint:changelog --rc
31+
- name: Validate changelog
32+
if: ${{ !startsWith(github.head_ref, 'release/') }}
33+
run: yarn lint:changelog
34+
- name: Require clean working directory
35+
shell: bash
36+
run: |
37+
if ! git diff --exit-code; then
38+
echo "Working tree dirty at end of job"
39+
exit 1
40+
fi

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ jobs:
1919
run: ${{ steps.download-actionlint.outputs.executable }} -color
2020
shell: bash
2121

22+
build-lint-test:
23+
name: Build, lint, and test
24+
uses: ./.github/workflows/build-lint-test.yml
25+
needs: check-workflows
26+
2227
all-jobs-completed:
2328
name: All jobs completed
2429
runs-on: ubuntu-latest
2530
needs:
2631
- check-workflows
32+
- build-lint-test
2733
outputs:
2834
PASSED: ${{ steps.set-output.outputs.PASSED }}
2935
steps:

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
[Unreleased]: https://github.com/MetaMask/security-code-scanner/
10+
[Unreleased]: https://github.com/MetaMask/action-security-code-scanner/

yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,23 @@ __metadata:
221221
languageName: node
222222
linkType: hard
223223

224+
"@metamask/action-security-code-scanner@workspace:.":
225+
version: 0.0.0-use.local
226+
resolution: "@metamask/action-security-code-scanner@workspace:."
227+
dependencies:
228+
"@actions/core": "npm:^1.10.1"
229+
"@actions/github": "npm:^6.0.0"
230+
"@lavamoat/allow-scripts": "npm:^3.3.1"
231+
"@lavamoat/preinstall-always-fail": "npm:^2.1.0"
232+
"@metamask/auto-changelog": "npm:^4.1.0"
233+
depcheck: "npm:^1.4.7"
234+
mixpanel: "npm:^0.18.0"
235+
prettier: "npm:^3.5.3"
236+
prettier-plugin-packagejson: "npm:^2.5.10"
237+
prettier-plugin-sh: "npm:^0.15.0"
238+
languageName: unknown
239+
linkType: soft
240+
224241
"@metamask/auto-changelog@npm:^4.1.0":
225242
version: 4.1.0
226243
resolution: "@metamask/auto-changelog@npm:4.1.0"
@@ -2087,23 +2104,6 @@ __metadata:
20872104
languageName: node
20882105
linkType: hard
20892106

2090-
"security-code-scanner@workspace:.":
2091-
version: 0.0.0-use.local
2092-
resolution: "security-code-scanner@workspace:."
2093-
dependencies:
2094-
"@actions/core": "npm:^1.10.1"
2095-
"@actions/github": "npm:^6.0.0"
2096-
"@lavamoat/allow-scripts": "npm:^3.3.1"
2097-
"@lavamoat/preinstall-always-fail": "npm:^2.1.0"
2098-
"@metamask/auto-changelog": "npm:^4.1.0"
2099-
depcheck: "npm:^1.4.7"
2100-
mixpanel: "npm:^0.18.0"
2101-
prettier: "npm:^3.5.3"
2102-
prettier-plugin-packagejson: "npm:^2.5.10"
2103-
prettier-plugin-sh: "npm:^0.15.0"
2104-
languageName: unknown
2105-
linkType: soft
2106-
21072107
"semver-compare@npm:^1.0.0":
21082108
version: 1.0.0
21092109
resolution: "semver-compare@npm:1.0.0"

0 commit comments

Comments
 (0)