@@ -103,45 +103,59 @@ jobs:
103
103
with :
104
104
github-token : ${{ secrets.MOVE2KUBE_PATOKEN }}
105
105
script : |
106
+ core.info('DEBUG 1 start');
106
107
const tag = '${{ github.event.inputs.tag }}';
107
108
const sha = '${{ steps.get_sha.outputs.sha }}';
109
+ core.info(`DEBUG 2 tag ${tag} sha ${sha}`);
108
110
109
111
let tag_exists = false;
110
112
try {
113
+ core.info('DEBUG 3 try checking if the tag exists');
111
114
const resp = await github.git.getRef({...context.repo, ref: `tags/${tag}`});
112
115
tag_exists = true;
113
116
core.info(`the tag ${tag} already exists on ${resp.data.object.type} ${resp.data.object.sha}`);
114
117
} catch(err) {
118
+ core.info('DEBUG 4 an error occurred while checking if the tag exists');
119
+ core.info(`DEBUG 5 err.status ${err.status}`);
115
120
if(err.status !== 404){
116
121
throw err;
117
122
}
123
+ core.info('DEBUG 6 the tag does not exist');
118
124
}
125
+ core.info('DEBUG 7 after checking if the tag exists');
119
126
if(tag_exists) {
127
+ core.info('DEBUG 8 the tag exists');
120
128
core.info(`deleting the tag ${tag}`);
121
129
const resp = await github.git.deleteRef({...context.repo, ref: `tags/${tag}`});
130
+ core.info('DEBUG 9 after deleting the existing tag');
122
131
}
123
-
132
+ core.info('DEBUG 10');
124
133
core.info(`creating the tag ${tag} on the commit ${sha}`);
125
134
github.git.createRef({
126
135
...context.repo,
127
136
ref: `refs/tags/${tag}`,
128
137
sha
129
138
});
139
+ core.info('DEBUG 11 after creating the tag');
130
140
if(!tag.endsWith('-beta.0')) {
141
+ core.info('DEBUG 12 the tag does not end with -beta.0');
131
142
return;
132
143
}
144
+ core.info('DEBUG 13 the tag ends with -beta.0 so create a new release branch');
133
145
// create the release branch
134
146
const major_minor = /^v(\d+\.\d+)/.exec(tag);
135
147
if(!major_minor || major_minor.length !== 2){
136
148
return core.setFailed(`The tag is not a valid semantic version. tag: ${tag}`);
137
149
}
150
+ core.info('DEBUG 14 creating the new release branch');
138
151
const branch_name = `release-${major_minor[1]}`;
139
152
core.info(`New beta.0 release. Creating new branch for ${branch_name}`);
140
153
github.git.createRef({
141
154
...context.repo,
142
155
ref: `refs/heads/${branch_name}`,
143
156
sha
144
157
});
158
+ core.info('DEBUG 15 after creating the new release branch');
145
159
146
160
create_release_draft :
147
161
needs : [tag]
0 commit comments