Skip to content

Commit 015ebf7

Browse files
committed
PR workflow
1 parent 3f70996 commit 015ebf7

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/pr.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Pull Request
2+
3+
on:
4+
# Note that GITHUB_SHA for this event is the last merge commit of the pull
5+
# request merge branch. If you want to get the commit ID for the last commit
6+
# to the head branch of the pull request,
7+
# use github.event.pull_request.head.sha instead.
8+
# Docs: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
branches:
12+
- 'v*'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-20.04
17+
18+
steps:
19+
- name: Clone repo
20+
uses: actions/checkout@v4
21+
22+
- name: Set .nvmrc content to stage output
23+
id: nvmrc
24+
run: |
25+
echo "node_version=$(cat .nvmrc | sed 's/v//g')" >> $GITHUB_OUTPUT
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v2
29+
with:
30+
node-version: ${{ steps.nvmrc.outputs.nvmrc }}
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Run tests
36+
run: npm run test
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GH_TKN }}

0 commit comments

Comments
 (0)