|
| 1 | +# |
| 2 | +# This is the canonical configuration for the `README.md` |
| 3 | +# Run `make readme` to rebuild the `README.md` |
| 4 | +# |
| 5 | + |
| 6 | +# Name of this project |
| 7 | +name: github-action-pre-commit |
| 8 | + |
| 9 | +# Tags of this project |
| 10 | +tags: |
| 11 | + - github-action |
| 12 | + |
| 13 | +# License of this project |
| 14 | +license: "APACHE2" |
| 15 | + |
| 16 | +# Canonical GitHub repo |
| 17 | +github_repo: cloudposse/github-action-pre-commit |
| 18 | + |
| 19 | +# Badges to display |
| 20 | +badges: |
| 21 | + - name: Latest Release |
| 22 | + image: https://img.shields.io/github/release/cloudposse/github-action-pre-commit.svg?style=for-the-badge |
| 23 | + url: https://github.com/cloudposse/github-action-pre-commit/releases/latest |
| 24 | + - name: Last Updated |
| 25 | + image: https://img.shields.io/github/last-commit/cloudposse/github-action-pre-commit.svg?style=for-the-badge |
| 26 | + url: https://github.com/cloudposse/github-action-pre-commit/commits |
| 27 | + - name: Slack Community |
| 28 | + image: https://slack.cloudposse.com/for-the-badge.svg |
| 29 | + url: https://cloudposse.com/slack |
| 30 | + |
| 31 | +# List any related terraform modules that this module may be used with or that this module depends on. |
| 32 | +related: [] |
| 33 | + |
| 34 | +# Short description of this project |
| 35 | +description: A GitHub action to run pre-commit |
| 36 | + |
| 37 | +introduction: |- |
| 38 | + This action is a fork of [pre-commit/action](https://github.com/pre-commit/action) |
| 39 | + that adds optional features for private repositories. |
| 40 | +
|
| 41 | + Permissions required: `repo` and `workflow`. |
| 42 | +
|
| 43 | +references: |
| 44 | + - name: "github-actions-workflows" |
| 45 | + description: "Reusable workflows for different types of projects" |
| 46 | + url: "https://github.com/cloudposse/github-actions-workflows" |
| 47 | + |
| 48 | +# How to use this project |
| 49 | +usage: |- |
| 50 | + ```yaml |
| 51 | + name: pre-commit |
| 52 | +
|
| 53 | + on: |
| 54 | + pull_request: |
| 55 | + push: |
| 56 | + branches: [main] |
| 57 | +
|
| 58 | + jobs: |
| 59 | + pre-commit: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: actions/setup-python@v5 |
| 64 | + - uses: cloudposse/github-action-pre-commit@v4.0.0 |
| 65 | + ``` |
| 66 | +
|
| 67 | + To run a specific hook or pass custom arguments: |
| 68 | +
|
| 69 | + ```yaml |
| 70 | + - uses: cloudposse/github-action-pre-commit@v4.0.0 |
| 71 | + with: |
| 72 | + extra_args: flake8 --all-files |
| 73 | + ``` |
| 74 | +
|
| 75 | + For private repositories, configure push-back support: |
| 76 | +
|
| 77 | + ```yaml |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + with: |
| 80 | + fetch-depth: 0 |
| 81 | +
|
| 82 | + - uses: cloudposse/github-action-pre-commit@v4.0.0 |
| 83 | + with: |
| 84 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + git_user_name: pre-commit |
| 86 | + git_user_email: pre-commit@users.noreply.github.com |
| 87 | + git_commit_message: pre-commit fixes |
| 88 | + ``` |
| 89 | +
|
| 90 | +include: [] |
| 91 | +contributors: [] |
0 commit comments