Skip to content

Commit c469c6c

Browse files
debug: cicd release failing with HTTP 404 error (#1188)
https://github.com/konveyor/move2kube/actions/runs/10039196758/job/27744113100#step:4:259 Signed-off-by: Harikrishnan Balagopal <[email protected]>
1 parent cbf1bd1 commit c469c6c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/release.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -103,45 +103,59 @@ jobs:
103103
with:
104104
github-token: ${{ secrets.MOVE2KUBE_PATOKEN }}
105105
script: |
106+
core.info('DEBUG 1 start');
106107
const tag = '${{ github.event.inputs.tag }}';
107108
const sha = '${{ steps.get_sha.outputs.sha }}';
109+
core.info(`DEBUG 2 tag ${tag} sha ${sha}`);
108110
109111
let tag_exists = false;
110112
try {
113+
core.info('DEBUG 3 try checking if the tag exists');
111114
const resp = await github.git.getRef({...context.repo, ref: `tags/${tag}`});
112115
tag_exists = true;
113116
core.info(`the tag ${tag} already exists on ${resp.data.object.type} ${resp.data.object.sha}`);
114117
} 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}`);
115120
if(err.status !== 404){
116121
throw err;
117122
}
123+
core.info('DEBUG 6 the tag does not exist');
118124
}
125+
core.info('DEBUG 7 after checking if the tag exists');
119126
if(tag_exists) {
127+
core.info('DEBUG 8 the tag exists');
120128
core.info(`deleting the tag ${tag}`);
121129
const resp = await github.git.deleteRef({...context.repo, ref: `tags/${tag}`});
130+
core.info('DEBUG 9 after deleting the existing tag');
122131
}
123-
132+
core.info('DEBUG 10');
124133
core.info(`creating the tag ${tag} on the commit ${sha}`);
125134
github.git.createRef({
126135
...context.repo,
127136
ref: `refs/tags/${tag}`,
128137
sha
129138
});
139+
core.info('DEBUG 11 after creating the tag');
130140
if(!tag.endsWith('-beta.0')) {
141+
core.info('DEBUG 12 the tag does not end with -beta.0');
131142
return;
132143
}
144+
core.info('DEBUG 13 the tag ends with -beta.0 so create a new release branch');
133145
// create the release branch
134146
const major_minor = /^v(\d+\.\d+)/.exec(tag);
135147
if(!major_minor || major_minor.length !== 2){
136148
return core.setFailed(`The tag is not a valid semantic version. tag: ${tag}`);
137149
}
150+
core.info('DEBUG 14 creating the new release branch');
138151
const branch_name = `release-${major_minor[1]}`;
139152
core.info(`New beta.0 release. Creating new branch for ${branch_name}`);
140153
github.git.createRef({
141154
...context.repo,
142155
ref: `refs/heads/${branch_name}`,
143156
sha
144157
});
158+
core.info('DEBUG 15 after creating the new release branch');
145159
146160
create_release_draft:
147161
needs: [tag]

0 commit comments

Comments
 (0)