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

feat: handle creating releases (#3)

This commit is contained in:
Benjamin E. Coe
2020-05-09 15:36:40 -07:00
committed by GitHub
parent c4b5d61f6c
commit e72afe059a
4 changed files with 712 additions and 609 deletions

View File

@@ -1,17 +1,27 @@
const core = require('@actions/core')
const { GitHubRelease } = require('release-please/build/src/github-release')
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')
const packageName = core.getInput('package-name')
// First we check for any merged release PRs (PRs merged with the label
// "autorelease: pending"):
const gr = new GitHubRelease({
label: RELEASE_LABEL,
repoUrl: process.env.GITHUB_REPOSITORY,
packageName
})
await gr.createRelease()
// Next we check for PRs merged since the last release, and groom the
// release PR:
const release = ReleasePRFactory.build(releaseType, {
packageName: name || 'unknown',
packageName: packageName,
apiUrl: 'https://api.github.com',
repoUrl: process.env.GITHUB_REPOSITORY,
token: token,