Skip to content

Commit d0570a7

Browse files
authored
Fix github-release action when the dev tag is missing (#6098)
There was a missing rest field access. In addition createTag doesn't actually create a tag, it creates a tag object. A tag object is an object which references a commit or other kind of object and has various kinds of metadata. You need to store it in a reference stored in refs/tags/ to actually show as tag in the git ui. The code to update the tag however creates a lightweight tag (which is a file in refs/tags/ which directly references a commit rather than a tag object) as such do the same when creating the initial dev tag by using createRef with a commit id as object sha. See also https://git-scm.com/book/en/v2/Git-Internals-Git-References for the difference between a lightweight tag and an annotated tag.
1 parent 3546ccf commit d0570a7

File tree

1 file changed

+3
-5
lines changed
  • .github/actions/github-release

1 file changed

+3
-5
lines changed

.github/actions/github-release/main.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ async function runOnce() {
5757
console.log("ERROR: ", JSON.stringify(e.data, null, 2));
5858
core.info(`creating dev tag`);
5959
try {
60-
await octokit.git.createTag({
60+
await octokit.rest.git.createRef({
6161
owner,
6262
repo,
63-
tag: 'dev',
64-
message: 'dev release',
65-
object: sha,
66-
type: 'commit',
63+
ref: 'refs/tags/dev',
64+
sha,
6765
});
6866
} catch (e) {
6967
// we might race with others, so assume someone else has created the

0 commit comments

Comments
 (0)