Skip to content

ci: see https://github.com/konveyor/move2kube/pull/371 for details #59

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

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Changes from all 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
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@ jobs:
script: |
const tag = '${{ github.event.inputs.tag }}';
const sha = '${{ steps.get_sha.outputs.sha }}';

let tag_exists = false;
try {
const resp = await github.git.getRef({...context.repo, ref: `tags/${tag}`});
tag_exists = true;
core.info(`the tag ${tag} already exists on ${resp.data.object.type} ${resp.data.object.sha}`);
} catch(err) {
if(err.status !== 404){
throw err;
}
}
if(tag_exists) {
core.info(`deleting the tag ${tag}`);
const resp = await github.git.deleteRef({...context.repo, ref: `tags/${tag}`});
}

core.info(`creating the tag ${tag} on the commit ${sha}`);
// create the tag
github.git.createRef({
...context.repo,
Expand Down Expand Up @@ -171,4 +188,4 @@ jobs:
return core.setFailed(`Expected the draft name to begin with [WIP]. Found: ${draft.name}`);
}
const new_name = draft.name.replace(/^\[WIP\] /, '');
await github.repos.updateRelease({...context.repo, release_id: draft.id, name: new_name});
await github.repos.updateRelease({...context.repo, release_id: draft.id, name: new_name, tag_name: draft.tag_name});