-
Notifications
You must be signed in to change notification settings - Fork 78
66 lines (54 loc) · 2.17 KB
/
refresh_dist.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
65
66
name: Refresh dist files
on:
pull_request:
types: [labeled]
jobs:
refresh:
if: contains(github.event.pull_request.labels.*.name, 'refresh dist')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- id: changed-package-json
uses: tj-actions/changed-files@v44
with:
files: |
**/package.json
**/package-lock.json
- id: changed-features
uses: tj-actions/changed-files@v44
with:
files: |
features/**/*.yml
features/**/*.yml.dist
- uses: actions/setup-node@v4
if: steps.changed-package-json.outputs.any_changed == 'true' || steps.changed-features.outputs.any_changed == 'true'
- run: npm install
if: steps.changed-package-json.outputs.any_changed == 'true' || steps.changed-features.outputs.any_changed == 'true'
- name: Refresh dist files for feature changes
if: steps.changed-package-json.outputs.any_changed == 'false' && steps.changed-features.outputs.any_changed == 'true'
env:
CHANGED_FEATURES: ${{ steps.changed-features.outputs.all_changed_files }}
run: |
npm run dist -- ${CHANGED_FEATURES}
- name: Refresh all dist files (for package*.json changes)
if: steps.changed-package-json.outputs.any_changed == 'true'
run: |
npm run dist
- uses: stefanzweifel/git-auto-commit-action@v5
if: steps.changed-package-json.outputs.any_changed == 'true' || steps.changed-features.outputs.any_changed == 'true'
with:
commit_message: Refresh dist files
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
- name: Save PR URL
env:
PR_URL: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_URL > ./pr/pr_url
- uses: actions/upload-artifact@v4
with:
name: pr_url
path: pr/