-
Notifications
You must be signed in to change notification settings - Fork 19
/
release-please.js
executable file
·44 lines (40 loc) · 1.31 KB
/
release-please.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
const core = require('@actions/core')
const { parseArgs } = require('util')
const ReleasePlease = require('../lib/release/release-please.js')
ReleasePlease.run({
token: process.env.GITHUB_TOKEN,
repo: process.env.GITHUB_REPOSITORY,
...parseArgs({
options: {
branch: { type: 'string' },
backport: { type: 'string' },
defaultTag: { type: 'string' },
},
}).values,
// This is mostly for testing and debugging. Use environs with the format
// `RELEASE_PLEASE_<manfiestOverrideConfigName>`
// (eg`RELEASE_PLEASE_lastReleaseSha=<SHA>`) to set one-off config items for
// the release please run without needing to commit and push the config.
overrides: Object.fromEntries(
Object.entries(process.env)
.filter(([k, v]) => k.startsWith('RELEASE_PLEASE_') && v != null)
.map(([k, v]) => [k.replace('RELEASE_PLEASE_', ''), v]),
),
})
.then(({ pr, releases }) => {
if (pr) {
core.setOutput('pr', JSON.stringify(pr))
core.setOutput('pr-branch', pr.headBranchName)
core.setOutput('pr-number', pr.number)
core.setOutput('pr-sha', pr.sha)
}
if (releases) {
core.setOutput('releases', JSON.stringify(releases))
}
return null
})
.catch(err => {
core.setFailed('Release Please failed')
core.error(err)
})