BUILD-3093 Setup a GitHub action to enforce pre-commit at CI level #67
Workflow file for this run
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
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
it-tests-use-config-path: | |
name: "IT Test - custom config-path" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Test pre-commit action on this same repository using a custom config-path | |
id: reuse-step | |
uses: ./ | |
with: | |
config-path: '.github/tests/resources/.pre-commit-config.yaml' | |
extra-args: '--all-files' | |
- name: json | |
run: | | |
echo $JSON | |
env: | |
JSON: ${{ toJSON(steps) }} | |
- name: Reuse output | |
run: | | |
echo "Pre-commit logs :" | |
echo "${{ steps.reuse-step.outputs.logs }}" | |
shell: bash | |
it-tests-use-default-config-path: | |
name: "IT Test - default inputs values" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Test pre-commit action on this same repository using default input values | |
uses: ./ | |
it-tests-use-extra-args-default: | |
name: "IT Test - custom extra-args" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Test pre-commit action on this same repository using --help extra-args | |
uses: ./ | |
with: | |
extra-args: --help |