|
99 | 99 | steps: |
100 | 100 | - name: Checkout |
101 | 101 | uses: actions/checkout@v4 |
102 | | - with: |
103 | | - ref: ${{ github.head_ref || github.ref_name }} |
104 | | - token: ${{ secrets.GITHUB_TOKEN }} |
105 | 102 |
|
106 | 103 | - name: Setup PHP |
107 | 104 | uses: shivammathur/setup-php@v2 |
@@ -134,30 +131,33 @@ jobs: |
134 | 131 | name: grid-screenshots |
135 | 132 | path: Tests/Screenshots/output/*.png |
136 | 133 |
|
137 | | - - name: Commit screenshots to branch |
| 134 | + - name: Push screenshots to separate ref |
138 | 135 | run: | |
| 136 | + SCREENSHOTS_REF="refs/screenshots/${{ github.head_ref || github.ref_name }}" |
139 | 137 | git config user.name "github-actions[bot]" |
140 | 138 | git config user.email "github-actions[bot]@users.noreply.github.com" |
141 | | - git add -f Tests/Screenshots/output/*.png |
142 | | - git diff --staged --quiet && echo "No screenshot changes" && exit 0 |
143 | | - git commit -m "Update grid screenshots" |
144 | | - git push |
| 139 | + git checkout --orphan screenshots-tmp |
| 140 | + git rm -rf . > /dev/null 2>&1 |
| 141 | + cp Tests/Screenshots/output/*.png . |
| 142 | + git add *.png |
| 143 | + git commit -m "Grid screenshots for ${{ github.head_ref || github.ref_name }}" |
| 144 | + git push origin HEAD:${SCREENSHOTS_REF} --force |
145 | 145 |
|
146 | 146 | - name: Comment on PR with screenshots |
147 | 147 | if: github.event_name == 'pull_request' |
148 | 148 | env: |
149 | 149 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
150 | 150 | run: | |
151 | 151 | REPO="${{ github.repository }}" |
152 | | - BRANCH="${{ github.head_ref }}" |
153 | | - SHA=$(git rev-parse HEAD) |
154 | | - BODY="## Grid Screenshots ($(date -u +%Y-%m-%d)) |
| 152 | + SCREENSHOTS_REF="refs/screenshots/${{ github.head_ref }}" |
| 153 | + REF_SHA=$(git rev-parse HEAD) |
| 154 | + BODY="## Grid Screenshots |
155 | 155 |
|
156 | 156 | **Table renderer:** |
157 | | -  |
| 157 | +  |
158 | 158 |
|
159 | 159 | **DataTables renderer:** |
160 | | -  |
| 160 | +  |
161 | 161 |
|
162 | 162 | _Auto-generated from [CI run](https://github.com/${REPO}/actions/runs/${{ github.run_id }})_" |
163 | 163 |
|
|
0 commit comments