Skip to content

πŸš‘οΈ Commit-Check korrigiert #20

πŸš‘οΈ Commit-Check korrigiert

πŸš‘οΈ Commit-Check korrigiert #20

Workflow file for this run

name: Run Tests
on:
pull_request:
branches:
- "main"
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref }}
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Letzte Commit-Message laden
id: last_commit
run: |
last_commit_msg=$(git log -1 --pretty=%s)
echo "lastcommit=$last_commit_msg" >> $GITHUB_ENV
- name: Load dependencies
run: npm ci
- name: Format code
run: npm run format-all
- name: Add corresponding commit
if: "!contains(env.lastcommit, '🎨 Code formatted')"
run: |
git config --global user.name 'OpenFoxes Maintenance Bot'
git config --global user.email '[email protected]'
git checkout ${{ github.event.pull_request.head.ref }}
git add .
git diff-index --quiet ${{ github.event.pull_request.head.ref }} || {
git commit -m "🎨 Code formatted"
git push origin ${{ github.event.pull_request.head.ref }}
}
- name: Run all tests
run: npm run test-cov
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload scan to Sonar
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}