Skip to content

Fix github actions

Fix github actions #1

Workflow file for this run

name: Node.js CI
on:
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Check for leaked secrets
uses: zricethezav/gitleaks-action@v1.6.0
- name: Compile
run: pnpm run build
- name: Run Tests
id: run_tests
run: |
if pnpm test; then
echo "Tests passed successfully" > test_results.md
echo "::set-output name=result::$(cat test_results.md)"
else
echo "Tests failed" > test_results.md
echo "::set-output name=result::$(cat test_results.md)"
exit 1
fi
env:
CI: true
- name: Comment PR with test results
if: github.event_name == 'pull_request'
uses: unsplash/comment-on-pr@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
📝 **Test Results:**
```
${{ steps.run_tests.outputs.result }}
```
check_for_duplicate_messages: true