update actions #62
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
name: Auto Format Config files & Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Run Black | |
uses: actionsx/prettier@v2 | |
with: | |
# prettier CLI arguments. | |
args: --write "**/*.yml" "**/*.md" | |
- name: Check for changes | |
id: check_changes | |
run: | | |
git diff --exit-code || echo "has_diff=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
id: commit_changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
- name: "Run if changes have been detected" | |
if: steps.commit_changes.outputs.changes_detected == 'true' | |
run: echo "Code formated." | |
- name: "Run if no changes have been detected" | |
if: steps.commit_changes.outputs.changes_detected == 'false' | |
run: echo "No Changes." |