Git & GitHub Interview Question #96

What are artifacts in GitHub Actions?

GitHub Collaboration, Repository Rules, Issues, Releases & Actions CI/CD Mid-Level Intermediate

Quick Interview Answer

Artifacts are files produced by a workflow that are uploaded and retained by GitHub for later download or use. Examples include compiled packages, test reports, logs, coverage reports, or deployment bundles.

Detailed Explanation

Artifacts are files produced by a workflow that are uploaded and retained by GitHub for later download or use. Examples include compiled packages, test reports, logs, coverage reports, or deployment bundles.

Artifacts allow outputs from automation to be preserved beyond the runner's temporary workspace. Retention and access should be configured appropriately, especially if generated files could contain sensitive information.

Code Example

steps:
  - run: dotnet publish -c Release -o ./publish

  - name: Upload published application
    uses: actions/upload-artifact@v4
    with:
      name: web-app
      path: ./publish