Releases/v1 (#1)

* delete package versions action v1

* updated action for build and smoke test

* test and error message update

* test fix

* ci testing

* ci testing

* ci testing

* ci testing

* ci test

* ci testing

* ci test name

* docs

* docs

* docs

* test

* test

* test

* docs

* usage doc

* doc

* docs

* format test

* doc update

* doc test

* formatting check

* scenario update

* usage update

* format

* test

* test

* test

* test

* test

* table test

* test

* format update

* links

* test

* test

* test

* test

* test

* docs update

* test

* formatting

* fix broken links

* doc update

* test

* table test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* doc test

* test

* test

* test

* test

* test

* test

* test

t

* test

* test

* test

* test

* test

* test

* docs

* doc update
This commit is contained in:
Trent Jones
2020-02-29 19:33:20 -06:00
committed by GitHub
parent 91c0d1036c
commit 54b504899d
21 changed files with 38317 additions and 456 deletions
+29 -13
View File
@@ -1,19 +1,35 @@
import * as core from '@actions/core'
import {wait} from './wait'
import {getInput, setFailed} from '@actions/core'
import {context} from '@actions/github'
import {Input} from './input'
import {Observable, throwError} from 'rxjs'
import {deleteVersions} from './delete'
import {catchError} from 'rxjs/operators'
async function run(): Promise<void> {
function getActionInput(): Input {
return new Input({
packageVersionIds: getInput('package-version-ids')
? getInput('package-version-ids').split(',')
: [],
owner: getInput('owner') ? getInput('owner') : context.repo.owner,
repo: getInput('repo') ? getInput('repo') : context.repo.repo,
packageName: getInput('package-name'),
numOldVersionsToDelete: Number(getInput('num-old-versions-to-delete')),
token: getInput('token')
})
}
function run(): Observable<boolean> {
try {
const ms: string = core.getInput('milliseconds')
core.debug(`Waiting ${ms} milliseconds ...`)
core.debug(new Date().toTimeString())
await wait(parseInt(ms, 10))
core.debug(new Date().toTimeString())
core.setOutput('time', new Date().toTimeString())
return deleteVersions(getActionInput()).pipe(
catchError(err => throwError(err))
)
} catch (error) {
core.setFailed(error.message)
return throwError(error.message)
}
}
run()
run().subscribe({
error: err => {
setFailed(err)
}
})