generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (43 loc) · 1.11 KB
/
package.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
name: Package
on:
pull_request:
paths:
- .github/workflows/package.yml
- dist/**
- src/**
- package-lock.json
- package.json
jobs:
package:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- id: generate_token
uses: tibdex/github-app-token@v1.6.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ github.head_ref }}
- run: npm install
- run: npm run format
- run: npm run build
- run: npm run lint
- run: npm run package
- name: Diff
id: diff
run: |
git status
git add -N .
git diff --name-only --exit-code
continue-on-error: true
- uses: snow-actions/git-config-user@v1.0.0
if: steps.diff.outcome == 'failure'
- name: Commit & Push
run: |
git add .
git commit -m 'npm run package'
git push
if: steps.diff.outcome == 'failure'