Skip to content

CICD-093 · Set an artifact retention period ​

Encyclopedia · Artifact handoffs · All snippets

Previous · CICD-092 · Next · CICD-094

1. Where it fits ​

  • Placement .github/workflows/ci.yml, under a job's steps.
  • Prerequisites actions runner, trusted producers and files actually generated by tests.
  • Platforms github-actions.

2. Copy the snippet ​

yaml
uses: actions/upload-artifact@v4
with:
  name: temporary-report
  path: reports/
  retention-days: 7

3. How it works ​

This invokes an action at step scope or a reusable workflow at job scope. The reference and declared inputs must match that contract.

4. Verify the result ​

Confirm configured retention complies with policy and the platform limit.

Validation syntax-validated (YAML parse). Status definitions.