forked from medplum/medplum
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.44 KB
/
danger.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
name: Danger
on:
workflow_run:
workflows: [Build]
types: [completed]
jobs:
danger:
name: Danger
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- id: stats
name: Log branch stats
run: |
BRANCH_NAME=$(git branch --show-current)
COMMIT_HASH=$(git rev-parse HEAD)
echo "Current branch: $BRANCH_NAME"
echo "Commit hash: $COMMIT_HASH"
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install deps
run: npm ci --maxsockets 1
- name: Build
run: npm run build:fast
- name: Danger
run: npx danger ci --failOnErrors
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.MEDPLUM_BOT_GITHUB_ACCESS_TOKEN }}