Skip to content

Commit

Permalink
Add pr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Oct 23, 2023
1 parent 74553ff commit ba578e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pull Request or Push

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
permissions:
contents: write
pull-requests: read
8 changes: 1 addition & 7 deletions .github/workflows/pre-commit-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
changed-files:
required: true
required: false
type: string
description: JSON string containing information about changed files

Expand All @@ -30,11 +30,5 @@ jobs:
pre-commit install --install-hooks
- name: Check ALL Files On Branch
if: github.event_name != 'pull_request'
run: |
pre-commit run --show-diff-on-failure --color=always --all-files
- name: Check Changed Files On PR
if: github.event_name == 'pull_request' && fromJSON(inputs.changed-files)['repo'] == 'true'
run: |
pre-commit run --show-diff-on-failure --color=always --files ${{ join(fromJSON(inputs.changed-files)['repo_files'], ' ') }}

0 comments on commit ba578e8

Please sign in to comment.