Skip to content

Commit ed1d9ad

Browse files
authored
feat: add github action (#101)
1 parent b47a6d5 commit ed1d9ad

File tree

7 files changed

+35124
-3
lines changed

7 files changed

+35124
-3
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ We recommend running Sherif in your CI once [all errors are fixed](#autofix). Ru
3838
<summary>GitHub Actions example</summary>
3939

4040
```yaml
41+
# Using the `actions/sherif` action
4142
name: Sherif
4243
on:
4344
pull_request:
@@ -46,8 +47,23 @@ jobs:
4647
name: Run Sherif
4748
runs-on: ubuntu-22.04
4849
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v4
50+
- uses: actions/checkout@v4
51+
- uses: actions/sherif@v1
52+
# Optionally, you can specify a version and arguments to run Sherif with:
53+
# with:
54+
# version: '1.0.1'
55+
# args: '--ignore-rule root-package-manager-field'
56+
57+
# Using `npx` to run Sherif
58+
name: Sherif
59+
on:
60+
pull_request:
61+
jobs:
62+
check:
63+
name: Run Sherif
64+
runs-on: ubuntu-22.04
65+
steps:
66+
- uses: actions/checkout@v4
5167
- uses: actions/setup-node@v3
5268
with:
5369
node-version: 20

action.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Setup Sherif'
2+
description: 'Setup and run Sherif, an opinionated, zero-config linter for JavaScript monorepos'
3+
4+
inputs:
5+
version:
6+
description: 'The Sherif version to use (e.g., v1.0.1)'
7+
required: false
8+
default: 'latest'
9+
github-token:
10+
description: 'GitHub token for API requests'
11+
required: false
12+
default: ${{ github.token }}
13+
args:
14+
description: 'Additional arguments to pass to Sherif'
15+
required: false
16+
default: ''
17+
18+
runs:
19+
using: 'node20'
20+
main: 'action/index.js'
21+
22+
branding:
23+
icon: 'shield'
24+
color: 'orange'

0 commit comments

Comments
 (0)