Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaKitazawa committed Sep 18, 2024
1 parent 5c130c4 commit 9a48c10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/reviewapp-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ jobs:
PREFIX: ui-
shell: bash -xe {0}
run: |
set -e
EXPECTED="$(gh pr list --repo ${{ github.repository }} --label 'reviewapps' --json number --jq '.[].number' | sed 's/^\(.*\)$/'$PREFIX'\1/g')"
ACTUAL="$(ls | grep -E ^$PREFIX)"
EXPECTED="$(gh pr list --repo ${{ github.repository }} --label 'reviewapps' --json number --jq '.[].number' | sed 's/^\(.*\)$/'"$PREFIX"'\1/g')"
# shellcheck disable=SC2010
ACTUAL="$(ls | grep -E \"^$PREFIX\")"
# If present only in ACTUAL, cleanup
for act in $ACTUAL; do
EXIST=false
for exp in $EXPECTED; do
[ "$act" = "$exp" ] && EXIST=true
done
[ $EXIST = true ] && continue
bash -x $act/cleanup.sh
rm -rf $act
[ "$EXIST" = "true" ] && continue
bash -x "$act/cleanup.sh"
rm -rf "$act"
done
- name: Commit files
Expand Down

0 comments on commit 9a48c10

Please sign in to comment.