From fdb8fdfc4764ae2b47ede7dd327c891f7a8a59f0 Mon Sep 17 00:00:00 2001 From: codycooperross <50597551+codycooperross@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:21:17 -0400 Subject: [PATCH] Update update_label.yml --- .github/workflows/update_label.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_label.yml b/.github/workflows/update_label.yml index 4b0fbd8..c2e56a3 100644 --- a/.github/workflows/update_label.yml +++ b/.github/workflows/update_label.yml @@ -8,7 +8,15 @@ jobs: permissions: issues: write steps: - - run: gh label list -R $DEST_REPO | grep "$NAME" && gh label edit "$NAME" -n "$NEW_NAME" -c $NEW_COLOR -d "$NEW_DESCRIPTION" -R $DEST_REPO + - run: | + response=$(gh label edit "$NAME" -n "$NEW_NAME" -c $NEW_COLOR -d "$NEW_DESCRIPTION" -R $DEST_REPO 2>&1) + exit_code=$? + + if [[ "$response" == *"404"* ]] || [[ $exit_code != 1 ]]; then + exit 0 + else + exit 1 + fi env: GH_TOKEN: ${{ secrets.GH_TOKEN }} GH_REPO: ${{ github.repository }}