mirror of
https://github.com/ivuorinen/actions.git
synced 2026-01-26 11:34:00 +00:00
feat: add GitHub Actions workflows for code quality and automation (#2)
This commit is contained in:
57
pre-commit/README.md
Normal file
57
pre-commit/README.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# ivuorinen/actions/pre-commit
|
||||
|
||||
## pre-commit
|
||||
|
||||
### Description
|
||||
|
||||
Runs pre-commit on the repository and pushes the fixes back to the repository
|
||||
|
||||
### Inputs
|
||||
|
||||
| name | description | required | default |
|
||||
| ------------------- | ------------------------------------- | -------- | --------------------------- |
|
||||
| `pre-commit-config` | <p>pre-commit configuration file</p> | `false` | `.pre-commit-config.yaml` |
|
||||
| `base-branch` | <p>Base branch to compare against</p> | `false` | `""` |
|
||||
| `token` | <p>GitHub Token</p> | `false` | `${{ github.token }}` |
|
||||
| `commit_user` | <p>Commit user</p> | `false` | `GitHub Actions` |
|
||||
| `commit_email` | <p>Commit email</p> | `false` | `github-actions@github.com` |
|
||||
|
||||
### Runs
|
||||
|
||||
This action is a `composite` action.
|
||||
|
||||
### Usage
|
||||
|
||||
```yaml
|
||||
- uses: ivuorinen/actions/pre-commit@main
|
||||
with:
|
||||
pre-commit-config:
|
||||
# pre-commit configuration file
|
||||
#
|
||||
# Required: false
|
||||
# Default: .pre-commit-config.yaml
|
||||
|
||||
base-branch:
|
||||
# Base branch to compare against
|
||||
#
|
||||
# Required: false
|
||||
# Default: ""
|
||||
|
||||
token:
|
||||
# GitHub Token
|
||||
#
|
||||
# Required: false
|
||||
# Default: ${{ github.token }}
|
||||
|
||||
commit_user:
|
||||
# Commit user
|
||||
#
|
||||
# Required: false
|
||||
# Default: GitHub Actions
|
||||
|
||||
commit_email:
|
||||
# Commit email
|
||||
#
|
||||
# Required: false
|
||||
# Default: github-actions@github.com
|
||||
```
|
||||
@@ -1,5 +1,8 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
|
||||
name: pre-commit
|
||||
description: "Runs pre-commit on the repository and pushes the fixes back to the repository"
|
||||
description: 'Runs pre-commit on the repository and pushes the fixes back to the repository'
|
||||
author: 'Ismo Vuorinen'
|
||||
|
||||
branding:
|
||||
icon: check-square
|
||||
@@ -7,23 +10,24 @@ branding:
|
||||
|
||||
inputs:
|
||||
pre-commit-config:
|
||||
description: "pre-commit configuration file"
|
||||
required: true
|
||||
description: 'pre-commit configuration file'
|
||||
required: false
|
||||
default: '.pre-commit-config.yaml'
|
||||
base-branch:
|
||||
description: "Base branch to compare against"
|
||||
description: 'Base branch to compare against'
|
||||
required: false
|
||||
token:
|
||||
description: "GitHub Token"
|
||||
description: 'GitHub Token'
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
commit_user:
|
||||
description: "Commit user"
|
||||
description: 'Commit user'
|
||||
required: false
|
||||
default: "GitHub Actions"
|
||||
default: 'GitHub Actions'
|
||||
commit_email:
|
||||
description: "Commit email"
|
||||
description: 'Commit email'
|
||||
required: false
|
||||
default: "github-actions@github.com"
|
||||
default: 'github-actions@github.com'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -54,5 +58,5 @@ runs:
|
||||
if: always() # Push changes even when pre-commit fails
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "style(pre-commit): autofix"
|
||||
commit_message: 'style(pre-commit): autofix'
|
||||
add_options: -u
|
||||
|
||||
Reference in New Issue
Block a user