Skip to content

Commit

Permalink
Add: update snapshotsでの削除が反映されるように
Browse files Browse the repository at this point in the history
[update snapshots]
  • Loading branch information
sevenc-nanashi committed Dec 2, 2024
1 parent 8558f54 commit 43a3139
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,19 @@ jobs:
if: needs.config.outputs.shouldUpdateSnapshots == 'true'
run: |
git add --intent-to-add tests/ # git diff に表示されるようにする
git diff tests/ # ロギング用
git status
git diff --binary tests/ > patch-${{ matrix.os }}.diff
# quotepathを無効化しないとxargs rmでエラーになる
git -c "core.quotepath=false" ls-files --deleted tests/ > removed-${{ matrix.os }}.txt
- name: Upload patch to artifact
if: needs.config.outputs.shouldUpdateSnapshots == 'true'
uses: actions/upload-artifact@v4
with:
name: updated-snapshots-${{ matrix.os }}
path: patch-${{ matrix.os }}.diff
path:
patch-${{ matrix.os }}.diff
removed-${{ matrix.os }}.txt

commit-snapshots:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -195,6 +199,7 @@ jobs:
git apply --allow-empty $patch
rm $patch
done
cat patches/removed-*.txt | xargs git rm
# 変更があるかチェック
if [ -n "$(git status --porcelain)" ]; then
Expand Down

0 comments on commit 43a3139

Please sign in to comment.