Skip to content

Commit

Permalink
fix: use short ref version where needed (#728)
Browse files Browse the repository at this point in the history
Use short ref version where needed
  • Loading branch information
dsotirakis authored Jan 29, 2025
1 parent a827467 commit bc42206
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ jobs:
const { data } = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref
ref: `tags/${tag}`, // Use tags/${tag} for getRef - see https://github.com/octokit/rest.js/issues/339
});
existingRef = data;
console.log(`Tag ${tag} exists:`, existingRef);
} catch (e) {
if (e.status !== 404) {
if (e.status === 404) {
console.log(`Tag ${tag} does not exist.`);
} else {
console.error(`Error fetching tag ${tag}:`, e);
throw e;
}
}
Expand All @@ -55,7 +59,7 @@ jobs:
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref,
ref: `tags/${tag}`, // Use tags/${tag} for updateRef - see https://github.com/octokit/rest.js/issues/339
sha,
force: true
});
Expand All @@ -78,7 +82,6 @@ jobs:
}
const releases = JSON.parse(process.env.RELEASES);
// Filter `releases` to get the `*--release_created` outputs where
// the value is `"true"`. Then strip off that suffix to get an array
// of components that were released.
Expand Down

0 comments on commit bc42206

Please sign in to comment.