Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flat-manager: Add 'end-of-life' and 'end-of-life-rebase' inputs #71

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions flat-manager/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ inputs:
description: >
A flat-manager token to publish into the repository.
required: true
end-of-life:
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
description: >
Mark build as end-of-life.
required: false
end-of-life-rebase:
description: >
Mark new refs as end-of-life. This one takes an ID that supersedes the current one. By the user's request, the application data may be preserved for the new application. Note, this is actually a prefix match, so if you say org.the.app=org.new.app, then something like org.the.app.Locale will be rebased to org.new.app.Locale.
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
required: false
runs:
using: "node12"
main: "dist/index.js"
23 changes: 20 additions & 3 deletions flat-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,28 @@ const run = (repository, flatManagerUrl, token) => {
])
.then(async () => {
let buildId = ''
const exitCode = await exec.exec('flat-manager-client', [
let args = [
'--token',
token,
token
]

if (end_of_life) {
args.push_back(`--end-of-life=${end_of_life}`)

if (end_of_life_rebase) {
args.push_back(`--end-of-life-rebase=${end_of_life_rebase}`)
} else {
throw Error('end-of-life has to be set if you want to use end-of-life-rebase')
}
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
}

args = args.concat([
'create',
flatManagerUrl,
repository
], {
])

const exitCode = await exec.exec('flat-manager-client', args, {
listeners: {
stdout: (data) => {
buildId += data.toString().trim()
Expand Down Expand Up @@ -61,5 +76,7 @@ if (require.main === module) {
core.getInput('repository'),
core.getInput('flat-manager-url'),
core.getInput('token')
core.getInput('end-of-life')
meisenzahl marked this conversation as resolved.
Show resolved Hide resolved
core.getInput('end-of-life-rebase')
)
}