Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial action implementation #1

Merged
merged 8 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/grit-check.yaml
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

Check warning on line 14 in .github/workflows/grit-check.yaml

View workflow job for this annotation

GitHub Actions / run

use_ubuntu

This is a no-op warning meant for testing. You can ignore it.
steps:
- name: Check out code
uses: actions/checkout@v4
- name: grit-check
uses: ./
with:
args: '.github'
2 changes: 2 additions & 0 deletions .grit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gritmodules
*.log
9 changes: 9 additions & 0 deletions .grit/grit.yaml
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"`
58 changes: 57 additions & 1 deletion README.md
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.
28 changes: 28 additions & 0 deletions action.yaml
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 }}