From 7b36e0853c7f9e2dc8815835fd7755b8e3f69a39 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Mon, 21 Oct 2024 09:54:10 +0300 Subject: [PATCH] ci: fix auto-update charm libraries automated flow --- .github/workflows/update-libs.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-libs.yaml b/.github/workflows/update-libs.yaml index 00409c2..7dd76bb 100644 --- a/.github/workflows/update-libs.yaml +++ b/.github/workflows/update-libs.yaml @@ -16,9 +16,23 @@ jobs: commit-username: maas-lander commit-email: 115650013+maas-lander@users.noreply.github.com + detect-open-prs: + name: Check open library updates PRs + needs: update-lib-region + runs-on: ubuntu-22.04 + outputs: + open_prs: ${{ steps.open-prs.outputs.open_prs }} + steps: + - name: Check for any pre-existing PR and save it in the output + id: open-prs + run: | + OPEN_PRS="$(gh pr list --head chore/auto-libs --state open --json id --jq 'length')" + echo "open_prs=$OPEN_PRS" >> "$GITHUB_OUTPUT" + update-lib-agent: name: Check libraries - needs: update-lib-region + needs: detect-open-prs + if: needs.detect-open-prs.outputs.open_prs == '0' uses: canonical/observability/.github/workflows/charm-update-libs.yaml@main secrets: inherit with: