Unit testing for data-process.R #2
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: Pre-commit and Auto Merge | |
on: | |
push: | |
branches: | |
- '**' # This will trigger on pushes to any branch | |
pull_request: | |
branches: | |
- '**' # This will trigger on PRs to any branch | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # Set the version you need | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit | |
run: | | |
pre-commit run --all-files | |
git config --global user.name "GitHub Action" | |
git config --global user.email "action@github.com" | |
git add . | |
- name: Commit changes | |
run: git commit -m "Apply pre-commit changes" || echo "No changes to commit" | |
- name: Merge changes | |
run: | | |
# Check if there are changes to push | |
if [ -n "$(git status --porcelain)" ]; then | |
git push origin "${{ github.ref }}" | |
else | |
echo "No changes to push." | |
fi |