forked from walters954/why-salesforce
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.29 KB
/
tests.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Format, Lint and add changes
on:
pull_request:
types:
- ready_for_review
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Switch branch
run: |
HEAD_REF="${{ github.head_ref }}"
if [ "$HEAD_REF" != "" && "$HEAD_REF" != "main" ]; then
git fetch origin $HEAD_REF
git switch $HEAD_REF
fi
- name: Run linter
run: deno task lint
- name: Verify formatting
run: deno task fmt
- name: Upload changes to base branch
run: |
HEAD_REF="${{ github.head_ref }}"
if [ "$HEAD_REF" != "" && "$HEAD_REF" != "main" ]; then
git config user.name "github-actions"
git config user.email "[email protected]"
git commit -am "deno formatting"
git push
fi