From 649501ad46dae4d8bcd62b7b24dbff89fe184d8c Mon Sep 17 00:00:00 2001 From: addetz <43963729+addetz@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:02:53 +0100 Subject: [PATCH] docs: add PR environment variable --- .github/workflows/clean-up-unused-images.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clean-up-unused-images.yaml b/.github/workflows/clean-up-unused-images.yaml index bd9bc4f4430..4b2184c4981 100644 --- a/.github/workflows/clean-up-unused-images.yaml +++ b/.github/workflows/clean-up-unused-images.yaml @@ -51,6 +51,12 @@ jobs: - name: Create PR with unused images run: | + unused_image_count=$(wc -l < unused_images.json) + if unused_image_count == 0; then + "No images found to remove." + exit 0 + fi + # Ensure that we are on master. git checkout master @@ -87,9 +93,10 @@ jobs: The images are identified using `scripts/find-unused-images.sh` script. Please review this PR carefully before merging it.' - gh pr create --base master --title "docs: clean up librarium unused images " --body "$pr_body" --label "$backport_labels" + echo ::set-env name=CREATED_CLEANUP_PR::$(gh pr create --base master --title "docs: clean up librarium unused images " --body "$pr_body" --label "$backport_labels") + + echo "PR successfully created ${{ env.CREATED_CLEANUP_PR }}" env: GH_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} -