Skip to content

Commit

Permalink
chore: Add discord-message action logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 20, 2024
1 parent c063ef6 commit f9644aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/actions/discord-message/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ const formatBody = (input) => {

async function getReleaseBody(name, version) {
const tag = `${name}@${version}`;
const result = await octokit.rest.repos.getReleaseByTag({
owner: 'urql-graphql',
repo: 'urql',
tag,
});
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
const result = await octokit.rest.repos.getReleaseByTag({ owner, repo, tag });

const release = result.status === 200 ? result.data : undefined;
if (!release || !release.body) return;
Expand Down Expand Up @@ -75,7 +72,8 @@ async function main() {
});

if (!response.ok) {
console.log('Something went wrong while sending the discord webhook.');
console.error('Something went wrong while sending the discord webhook.', response.status);
console.error(await response.text());
return;
}

Expand Down

0 comments on commit f9644aa

Please sign in to comment.