From 035ac088c71c469f1a5ba1ebb5c3bc0d2994121b Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 16 Dec 2024 13:10:13 +0100 Subject: [PATCH] fix: update GitHub Actions workflow to conditionally upload SDK artifacts and add cleanup step for non-push events (#1562) --- .github/workflows/upload-sdk-artifact.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-sdk-artifact.yml b/.github/workflows/upload-sdk-artifact.yml index b057a067e..685993dcf 100644 --- a/.github/workflows/upload-sdk-artifact.yml +++ b/.github/workflows/upload-sdk-artifact.yml @@ -4,7 +4,6 @@ on: push: branches: - master -on: pull_request: branches: - master @@ -82,6 +81,17 @@ jobs: ) - uses: actions/upload-artifact@v4 + if: github.event_name == 'push' with: name: sdk-${{ matrix.generator }}-${{ github.sha }} path: ./sdk + + cleanup-artifacts: + runs-on: ubuntu-latest + needs: + - generate-and-upload-sdk + if: github.event_name != 'push' + steps: + - uses: geekyeggo/delete-artifact@v5 + with: + name: swagger-*