Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
ktrz committed Mar 28, 2024
1 parent a87e362 commit fddd1b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased
- **fix** Rust benchmarks not comparing to baseline (#235)
- **feat** Comment on PR and auto update comment (#223)

<a name="v1.19.3"></a>
# [v1.19.3](https://github.com/benchmark-action/github-action-benchmark/releases/tag/v1.19.3) - 02 Feb 2024
Expand Down
7 changes: 3 additions & 4 deletions src/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,13 @@ async function handleAlert(benchName: string, curSuite: Benchmark, prevSuite: Be
core.debug(`Found ${alerts.length} alerts`);
const body = buildAlertComment(alerts, benchName, curSuite, prevSuite, alertThreshold, alertCommentCcUsers);
let message = body;
let url = null;

if (commentOnAlert) {
if (!githubToken) {
throw new Error("'comment-on-alert' input is set but 'github-token' input is not set");
}
const res = await leaveComment(curSuite.commit.id, body, `${benchName} Alert`, githubToken);
url = res.data.html_url;
const url = res.data.html_url;
message = body + `\nComment was generated at ${url}`;
}

Expand Down Expand Up @@ -357,7 +356,7 @@ function addBenchmarkToDataJson(
return prevBench;
}

function isRemoteRejectedError(err: unknown) {
function isRemoteRejectedError(err: unknown): err is Error {
if (err instanceof Error) {
return ['[remote rejected]', '[rejected]'].some((l) => err.message.includes(l));
}
Expand Down Expand Up @@ -436,7 +435,7 @@ async function writeBenchmarkToGitHubPagesWithRetry(
console.log(
`Automatically pushed the generated commit to ${ghPagesBranch} branch since 'auto-push' is set to true`,
);
} catch (err: any) {
} catch (err: unknown) {
if (!isRemoteRejectedError(err)) {
throw err;
}
Expand Down

0 comments on commit fddd1b8

Please sign in to comment.