Skip to content

Commit

Permalink
add filter for push
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Mar 20, 2024
1 parent e3800d2 commit 2d4a5c0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/yaml_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ on:
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!main' # excludes main
merge_group:

jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/[email protected]
id: filter
with:
filters: |
yaml_file_change:
- added|modified: '**.yml'
- name: Setup Go
uses: actions/setup-go@v4
with:
Expand All @@ -24,10 +31,12 @@ jobs:
- name: Format YAML files
run: yamlfmt config
- name: Add formatting changes
if: steps.filter.outputs.julia_file_change == 'true'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Automatic YAML formatting"
- name: Push changes to current branch
if: steps.filter.outputs.julia_file_change == 'true'
run: git push origin ${{ github.head_ref }}

0 comments on commit 2d4a5c0

Please sign in to comment.