Skip to content

Commit

Permalink
devops: check for changes before commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusvrs committed Aug 13, 2024
1 parent 50f26ca commit 6f3444c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ jobs:
- name: Run ESLint
run: npx eslint --fix --max-warnings 0

- name: Check for changes
id: check_changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changes_detected=true" >> $GITHUB_ENV
else
echo "No changes detected, skipping commit."
fi
- name: Commit and push changes
if: ${{ env.changes_detected == 'true' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit 6f3444c

Please sign in to comment.