-
Notifications
You must be signed in to change notification settings - Fork 14
64 lines (61 loc) · 1.81 KB
/
canopeum_frontend_pr_validation.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Frontend PR validation
on:
push:
branches:
- main
paths:
- "canopeum_frontend/**"
- ".github/workflows/canopeum_frontend_pr_validation.yml"
pull_request:
branches:
- main
- production
paths:
- "canopeum_frontend/**"
- ".github/workflows/canopeum_frontend_pr_validation.yml"
jobs:
Lint-Autofixes:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_frontend
# Only run autofixes on PRs
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
# Token with Contents permissions to allow retriggering workflow
token: ${{ secrets.PR_AUTOFIX_PAT }}
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run lint:fix
- name: Commit autofixes
uses: EndBug/add-and-commit@v9
# Push autofixes even on failure & prevent infinite loops
if: ${{ !cancelled() && github.event.head_commit.author.name != 'github-actions' }}
with:
default_author: github_actions
- name: Logging
if: ${{ !cancelled() }}
run: echo "${{toJSON(github.actor)}}"
- name: Logging
if: ${{ !cancelled() }}
run: echo "${{github.actor}}"
- name: Logging
if: ${{ !cancelled() }}
run: echo "${{github.triggering_actor}}"
- name: Logging
if: ${{ !cancelled() }}
run: echo "${{toJSON(github)}}"
Build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run build