|
1 | 1 | # Each `push on master` will persist image-snapshots that used as compare target in visual regression.
|
2 | 2 |
|
3 |
| -name: Visual Regression Persist Finish |
| 3 | +name: 👁️ Visual Regression Persist Finish |
4 | 4 |
|
5 | 5 | on:
|
6 | 6 | workflow_run:
|
7 |
| - workflows: ["name: Visual Regression Persist Start"] |
| 7 | + workflows: ["👁️ Visual Regression Persist Start"] |
8 | 8 | types:
|
9 | 9 | - completed
|
10 | 10 |
|
@@ -76,32 +76,38 @@ jobs:
|
76 | 76 | workflow: ${{ github.event.workflow_run.workflow_id }}
|
77 | 77 | run_id: ${{ github.event.workflow_run.id }}
|
78 | 78 | name: image-snapshots
|
79 |
| - path: imageSnapshots |
| 79 | + path: ./ |
80 | 80 |
|
81 | 81 | - name: Persist to Snapshot Repo
|
82 |
| - if: github.event.pull_request.head.ref == 'master' |
| 82 | + if: github.ref_name == 'master' |
83 | 83 | id: persist
|
84 | 84 | continue-on-error: true
|
85 | 85 | env:
|
86 | 86 | GITHUB_TOKEN: ${{ secrets.ANTD_IMAGE_SNAP_REPO_TOKEN }}
|
87 | 87 | # should push to snapshot repo firstly
|
88 | 88 | # push the single folder to the repo
|
89 | 89 | run: |
|
90 |
| - git config user.name "Antd Visual-Regression Bot" |
91 |
| - git config user.email "<>" |
| 90 | + git clone https://[email protected]/ant-design/antd-image-snapshots.git |
92 | 91 |
|
93 |
| - git clone [email protected]:ant-design/antd-image-snapshots.git |
94 |
| - rm antd-image-snapshots/*.txt |
95 |
| - rm -rf antd-image-snapshots/imageSnapshots |
| 92 | + echo "✅ Clone Finished" |
96 | 93 |
|
| 94 | + rm antd-image-snapshots/*.txt |
97 | 95 | mv visual-regression-ref.txt antd-image-snapshots/
|
98 |
| - mv ./imageSnapshots antd-image-snapshots/ |
| 96 | +
|
| 97 | + rm -rf antd-image-snapshots/imageSnapshots/* |
| 98 | + tar -xzvf imageSnapshots.tar.gz -C antd-image-snapshots/imageSnapshots |
| 99 | +
|
| 100 | + echo "✅ Changes Finished" |
99 | 101 |
|
100 | 102 | cd antd-image-snapshots
|
101 |
| - git add . |
102 |
| - git cm -m 'feat: update snapshot from ${{steps.visuall-regression.outputs.id}}' |
103 | 103 |
|
104 |
| - git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | \ |
105 |
| - xargs -L1 git config --unset-all |
| 104 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 105 | + git config --local user.name "github-actions[bot]" |
| 106 | +
|
| 107 | + git commit -a -m 'feat: update snapshot from ${{steps.visuall-regression.outputs.id}}' |
| 108 | +
|
| 109 | + echo "✅ Commit Finished" |
| 110 | +
|
| 111 | + git push --prune https://vaugsX:[email protected]/ant-design/antd-image-snapshots.git +refs/remotes/origin/*:refs/heads/* |
106 | 112 |
|
107 |
| - git push --prune https://token:[email protected]/ant-design/antd-image-snapshots.git +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/* |
| 113 | + echo "✅ Push Finished" |
0 commit comments