A modern, secure, and flexible GitHub Action for uploading artifacts with filtering, policy enforcement, and SHA256 integrity validation — built on top of the latest artifact backend.
- Multi-path uploads (files + directories)
- Smart compression
- Auto zip directories
- Direct upload for single files
- Include / Exclude filtering (glob-based)
- SHA256 integrity validation
- Policy enforcement
enforce→ fail pipelineaudit→ warn and continue
- Retention control
- Resilient + predictable behavior
- Fully compatible with GitHub Artifact v4 backend
Use directly from your repository:
- name: Upload Artifact
uses: your-org/advanced-upload-artifact@v1| Input | Required | Default | Description | ||
|---|---|---|---|---|---|
name |
✅ | — | Base name for the artifact | ||
path |
✅ | — | Comma-separated files/directories | ||
artifact-prefix |
❌ | "" |
Prefix for artifact naming | ||
retention-days |
❌ | 7 |
Artifact retention duration | ||
compression |
❌ | auto |
`auto | always | never` |
include |
❌ | "" |
Glob include patterns | ||
exclude |
❌ | "" |
Glob exclude patterns | ||
policy-mode |
❌ | enforce |
`enforce | audit` | |
fail-on-risk |
❌ | true |
Fail on detected risks |
- name: Upload build
uses: your-org/advanced-upload-artifact@v1
with:
name: build
path: dist/- name: Upload multiple artifacts
uses: your-org/advanced-upload-artifact@v1
with:
name: release
path: dist/,report.json,logs/- name: Upload filtered artifacts
uses: your-org/advanced-upload-artifact@v1
with:
name: filtered-build
path: dist/
include: "**/*.html,**/*.json"
exclude: "**/*.log,**/node_modules/**"- name: Upload with audit mode
uses: your-org/advanced-upload-artifact@v1
with:
name: safe-upload
path: dist/
policy-mode: audit
fail-on-risk: false- name: Upload production artifact
uses: your-org/advanced-upload-artifact@v1
with:
name: build
artifact-prefix: prod-
path: dist/
retention-days: 14| Scenario | Behavior |
|---|---|
| Single file | Uploaded directly |
| Directory | Zipped automatically |
| Multiple paths | Uploaded as separate artifacts |
| Missing path | Fail or warn (based on policy) |
| Empty file | Detected as risk |
| Mode | Behavior |
|---|---|
enforce |
Fails workflow on risk |
audit |
Logs warning and continues |
- SHA256 checksum computed before upload
- No deprecated APIs
- Uses modern GitHub artifact backend
- Removes vulnerable Octokit dependency chain
npm install
npm run buildEnsure dist/index.js is committed:
npm run buildInput → Filter → Compress → Hash → Upload → Validate
- Multi-file upload (no zip mode)
- Artifact manifest generation
- Artifact signing (cosign-style)
- Upload telemetry
PRs are welcome. If it improves performance, security, or developer experience — even better.
MIT
- If this helped you, give it a ⭐
- It helps the project grow and reach more builders.
