1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-13 12:01:37 +02:00

feat!: initial implementation of logic for running release please

This commit is contained in:
bcoe
2020-05-09 14:55:31 -07:00
parent 362d78e59b
commit 196390b866
18 changed files with 57175 additions and 2 deletions

33
index.js Normal file
View File

@@ -0,0 +1,33 @@
const core = require('@actions/core')
const { ReleasePRFactory } = require('release-please/build/src/release-pr-factory')
const RELEASE_LABEL = 'autorelease: pending'
const action = core.getInput('action')
async function main () {
const token = core.getInput('token')
const releaseType = core.getInput('release-type')
const name = core.getInput('name')
switch (action) {
case 'update-pr': {
const release = ReleasePRFactory.build(releaseType, {
packageName: name || 'unknown',
apiUrl: 'https://api.github.com',
repoUrl: process.env.GITHUB_REPOSITORY,
token: token,
label: RELEASE_LABEL
})
await release.run()
break
}
default:
core.setFailed(`unknown action, ${action}, should be "update-pr", or "create-release".`)
break
}
}
main().catch(err => {
core.setFailed(`release-please failed to ${action} (${err.message})`)
})