-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (30 loc) · 997 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install Dependencies
run: npm install
- name: Run Linter
run: npm run lint
- name: Run Tests
run: npm run test
# - name: Upload Code Coverage Results
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: ./coverage/coverage-final.json
- name: Create Dynamic Pull Request
id: create_pr
run: |
commit_msg=$(git log --format=%B -n 1 $GITHUB_SHA)
title="Automated PR: $commit_msg"
body="This PR was created automatically when tests passed. Commit message: $commit_msg"
gh pr create --title "$title" --body "$body" --base main
env:
GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN }}