Skip to content

Commit a265a1a

Browse files
committed
detect whether PR or not
1 parent f357b0b commit a265a1a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { Octokit } from "@octokit/action";
22
import { readFileSync } from "fs";
33

4+
// if the action is triggered by not a pull request, exit
5+
if (!process.env.GITHUB_REF?.startsWith("refs/pull/")) {
6+
console.log("Not a pull request, exiting.");
7+
process.exit(0);
8+
}
9+
410
const octokit = new Octokit();
511

612
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/")!;

0 commit comments

Comments
 (0)