-
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.
feat: initial action implementation (#1)
- Loading branch information
Showing
5 changed files
with
117 additions
and
1 deletion.
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,21 @@ | ||
name: grit-check-pre-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: grit-check | ||
uses: ./ | ||
with: | ||
args: '.github' |
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,2 @@ | ||
.gritmodules | ||
*.log |
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,9 @@ | ||
version: 0.0.1 | ||
patterns: | ||
- name: github.com/getgrit/stdlib#* | ||
- name: use_ubuntu | ||
description: 'This is a no-op warning meant for testing. You can ignore it.' | ||
level: warn | ||
body: | | ||
language yaml | ||
`runs-on: ubuntu-latest` => `runs-on: "ubuntu-latest"` |
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 |
---|---|---|
@@ -1 +1,57 @@ | ||
# github-action-check | ||
# Grit GitHub Action | ||
|
||
This action runs the Grit CLI to report any violations of your configured [Grit patterns](https://docs.grit.io/guides/config). | ||
|
||
## Usage | ||
|
||
You can add it as a step in your GitHub Actions workflow to automatically check for violations on every push: | ||
|
||
``` | ||
- name: Grit | ||
uses: getgrit/github-action-check@v0 | ||
with: | ||
# Optional additional arguments to pass to the `grit check` command | ||
args: '' | ||
``` | ||
|
||
## Inputs | ||
|
||
### `args` | ||
Specify [additional arguments](https://docs.grit.io/cli/reference#grit-check) to pass to the `grit check` command. | ||
|
||
By default, only warning and error patterns are reported. To include info patterns, use `--level`. | ||
|
||
``` | ||
- name: Grit | ||
uses: getgrit/github-action-check@v0 | ||
with: | ||
args: '--level info' | ||
``` | ||
|
||
## Example workflow | ||
|
||
``` | ||
name: grit-check | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: grit-check | ||
uses: getgrit/github-action-check@v0 | ||
``` | ||
|
||
## License | ||
This action code is released under the [MIT License](LICENSE). | ||
|
||
The Grit CLI is not included in this repository and is licensed separately. |
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,28 @@ | ||
# Copyright (c) Iuvo AI, Inc. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
name: 'Grit Check' | ||
description: 'Run Grit checks via GitHub actions' | ||
inputs: | ||
args: | ||
description: 'Optional additional arguments to `grit check`' | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: install grit | ||
shell: bash | ||
id: download | ||
run: | | ||
curl -fsSL https://docs.grit.io/install | bash | ||
- name: init grit | ||
id: init | ||
shell: bash | ||
run: | | ||
grit init | ||
- name: run grit check | ||
id: check | ||
shell: bash | ||
run: | | ||
grit check --github-actions ${{ inputs.args }} |