diff --git a/.github/workflows/_build-packages.yml b/.github/workflows/_build-packages.yml index d0c14f8d33..bb065ddd4f 100644 --- a/.github/workflows/_build-packages.yml +++ b/.github/workflows/_build-packages.yml @@ -26,10 +26,14 @@ jobs: - uses: actions/checkout@v3 - run: | mkdir dist && touch dist/.placeholder + - name: Keep artifact + id: keep-artifact + run: python -c "print('DAYS=' + str(5 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 with: name: ${{ inputs.artifact-name }} path: dist + retention-days: ${{ steps.keep-artifact.outputs.DAYS }} build-packages: diff --git a/.github/workflows/_legacy-checkpoints.yml b/.github/workflows/_legacy-checkpoints.yml index e29e896101..ede0eb48af 100644 --- a/.github/workflows/_legacy-checkpoints.yml +++ b/.github/workflows/_legacy-checkpoints.yml @@ -100,11 +100,16 @@ jobs: run: | bash generate_checkpoints.sh ${{ inputs.pl_version }} + - name: Keep artifact + id: keep-artifact + run: python -c "print('DAYS=' + str(30 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT + - name: Upload checkpoints to GitHub Actions artifact uses: actions/upload-artifact@v3 with: name: checkpoints-${{ github.sha }} path: ${{ env.legacy_dir }}/checkpoints/ + retention-days: ${{ steps.keep-artifact.outputs.DAYS }} - name: Upload checkpoints to S3 (dryrun) working-directory: ${{ env.legacy_dir }} diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 05db9c7f3a..a3cd6106f0 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -127,11 +127,16 @@ jobs: run: make linkcheck continue-on-error: true + - name: Keep artifact + id: keep-artifact + run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT + - name: Upload built docs uses: actions/upload-artifact@v3 with: name: docs-${{ matrix.pkg-name }}-${{ github.sha }} path: docs/build/html/ + retention-days: ${{ steps.keep-artifact.outputs.DAYS }} deploy-docs: