Skip to content

Commit

Permalink
fix: don't error on invalid call
Browse files Browse the repository at this point in the history
When the action is run outside of a pull request, the `base_ref` is not
provided and the action should not error. Instead, it should log a
message and skip the run.
  • Loading branch information
boredland committed Jan 30, 2025
1 parent fadb533 commit 6d33a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const run = async () => {
const base_ref = getInput("base_ref") === "" ? undefined : getInput("base_ref");
const ref = context.payload.pull_request?.base.ref;
if (!base_ref && !ref) {
throw new Error("No 'base_ref' provided and not a pull request");
console.log("No 'base_ref' provided and not a pull request. Skipping.");
}
const results: Parameters<typeof formatDiffMd>[1] = [];
const globber = await createGlob(getInput("files"));
Expand Down

0 comments on commit 6d33a2c

Please sign in to comment.