mirror of
https://github.com/actions/toolkit
synced 2025-05-09 00:22:56 +00:00
Add an option to specify retention days for artifacts (#575)
* Add an option to specify retention days for artifacts * Validate against settings exposed as env var to give early feedback * Fix lint * Add tests and addressing feedback * Update packages/artifact/__tests__/upload.test.ts Co-authored-by: Konrad Pabjan <konradpabjan@github.com> * Update packages/artifact/README.md Co-authored-by: Konrad Pabjan <konradpabjan@github.com> * Update packages/artifact/src/internal/utils.ts Co-authored-by: Konrad Pabjan <konradpabjan@github.com> * Update packages/artifact/__tests__/util.test.ts Co-authored-by: Konrad Pabjan <konradpabjan@github.com> Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
This commit is contained in:
parent
71b19c1d65
commit
ace7a82469
10 changed files with 97 additions and 5 deletions
|
@ -106,6 +106,20 @@ describe('Utils', () => {
|
|||
}
|
||||
})
|
||||
|
||||
it('Test negative artifact retention throws', () => {
|
||||
expect(() => {
|
||||
utils.getProperRetention(-1, undefined)
|
||||
}).toThrow()
|
||||
})
|
||||
|
||||
it('Test no setting specified takes artifact retention input', () => {
|
||||
expect(utils.getProperRetention(180, undefined)).toEqual(180)
|
||||
})
|
||||
|
||||
it('Test artifact retention must conform to max allowed', () => {
|
||||
expect(utils.getProperRetention(180, '45')).toEqual(45)
|
||||
})
|
||||
|
||||
it('Test constructing artifact URL', () => {
|
||||
const runtimeUrl = getRuntimeUrl()
|
||||
const runId = getWorkFlowRunId()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue