Skip to content

fix: minimal fixes on test action #35

fix: minimal fixes on test action

fix: minimal fixes on test action #35

Workflow file for this run

name: Test
on: [push]
jobs:
lint:
name: Lint project
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Revert changes into the package-lock.json file
run: git checkout -- package-lock.json
- name: Run lint
run: npm run lint
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "✅ Changes detected after linting, preparing to commit..."
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "ℹ️ No changes after linting, nothing to do, skipping commit"
fi
- name: Commit lint fixes
if: steps.verify-changed-files.outputs.changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: 'feat: automated lint with biome'
file_pattern: '.'
test:
name: Testing TPG
runs-on: ubuntu-latest
needs: lint
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Run test
run: npm run test