|
8 | 8 | changeDetection: |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | outputs: |
11 | | - hasChanges: ${{ steps.evaluation.outputs.hasChanges }} |
| 11 | + hasChanges: ${{ steps.changed-files.outputs.any_changed || 'true' }} |
12 | 12 | steps: |
13 | 13 | - uses: actions/checkout@v4 |
14 | 14 | with: |
15 | | - ref: ${{ github.head_ref || github.ref }} |
16 | 15 | fetch-depth: 0 |
17 | 16 |
|
18 | 17 | - name: Inject slug/short variables |
19 | 18 | uses: rlespinasse/github-slug-action@v4 |
20 | 19 |
|
21 | | - # Cache handling to determine the last commit id of unicorn deployment |
22 | | - # 1. Load cache file |
23 | | - # 2. Read SHA from file |
24 | | - # 3. Check if commit SHA has changed |
25 | | - # 4. Update cache if necessary |
26 | | - - name: Get last commit info file from cache |
27 | | - id: sha-cache |
28 | | - uses: actions/cache@v4 |
29 | | - with: |
30 | | - path: last_commit_sha.txt |
31 | | - key: last-commit-${{ env.GITHUB_REF_NAME_SLUG_URL }}-${{ github.run_id }} |
32 | | - restore-keys: last-commit-${{ env.GITHUB_REF_NAME_SLUG_URL }} |
33 | | - |
34 | | - - name: Read commit sha from file |
35 | | - id: last-commit |
36 | | - run: test -f last_commit_sha.txt |
37 | | - && echo "sha=$(cat last_commit_sha.txt)" >> $GITHUB_OUTPUT |
38 | | - || echo "sha=${{ github.event.pull_request.base.sha || github.event.before }}" >> $GITHUB_OUTPUT |
39 | | - |
40 | | - - name: Save commit SHA to cache |
41 | | - id: current-commit |
42 | | - run: echo "${{ github.event.pull_request.head.sha || github.sha }}" > last_commit_sha.txt |
43 | | - && echo "sha=${{ github.event.pull_request.base.sha || github.sha }}" >> $GITHUB_OUTPUT |
44 | | - |
45 | 20 | - name: Get changed files |
46 | | - if: steps.current-commit.outputs.sha != steps.last-commit.outputs.sha |
47 | 21 | id: changed-files |
48 | | - uses: tj-actions/changed-files@v41 |
| 22 | + uses: tj-actions/changed-files@v45 |
49 | 23 | with: |
50 | | - sha: ${{ steps.current-commit.outputs.sha }} |
51 | | - base_sha: ${{ steps.last-commit.outputs.sha }} |
52 | 24 | files: | |
53 | | - packages/elements |
54 | | - packages/storybook |
55 | | -
|
56 | | - - name: Print all changed files |
57 | | - if: steps.current-commit.outputs.sha != steps.last-commit.outputs.sha |
58 | | - run: echo '${{ toJSON(steps.changed-files.outputs.all_changed_and_modified_files) }}' |
59 | | - |
60 | | - - name: Check if storybook or elements was changed |
61 | | - if: steps.changed-files.outputs.all_changed_and_modified_files != '' |
62 | | - || steps.current-commit.outputs.sha == steps.last-commit.outputs.sha |
63 | | - id: evaluation |
64 | | - run: echo "hasChanges=true" >> $GITHUB_OUTPUT |
| 25 | + packages/elements/** |
| 26 | + packages/storybook/** |
65 | 27 |
|
66 | 28 | deploy: |
67 | 29 | runs-on: ubuntu-latest |
|
0 commit comments