Skip to content

Commit

Permalink
Skip when dependabot[bot] actor
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Jul 5, 2024
1 parent 35540d2 commit 980704f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45385,6 +45385,8 @@ function getInputs() {
domain: core.getInput("domain"),
setup_only: core.getBooleanInput("setup_only"),
pr_comment: core.getBooleanInput("pr_comment"),
github_actor: core.getInput("github_actor"),
github_token: core.getInput("github_token"),
// Inputs shared between buf steps.
input: core.getInput("input"),
paths: core.getMultilineInput("paths"),
Expand Down Expand Up @@ -45717,9 +45719,13 @@ function parseModuleName(moduleName) {
// main is the entrypoint for the action.
async function main() {
const inputs = getInputs();
const github = (0,lib_github.getOctokit)(core.getInput("github_token"));
const github = (0,lib_github.getOctokit)(inputs.github_token);
const [bufPath, bufVersion] = await installBuf(github, inputs.version);
core.setOutput(Outputs.BufVersion, bufVersion);
if (inputs.github_actor == "dependabot[bot]") {
core.info("Skipping steps for dependabot");
return;
}
await login(bufPath, inputs);
if (inputs.setup_only) {
core.info("Setup only, skipping steps");
Expand Down
4 changes: 4 additions & 0 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export interface Inputs {
domain: string;
setup_only: boolean;
pr_comment: boolean;
github_actor: string;
github_token: string;

input: string;
paths: string[];
Expand All @@ -53,6 +55,8 @@ export function getInputs(): Inputs {
domain: core.getInput("domain"),
setup_only: core.getBooleanInput("setup_only"),
pr_comment: core.getBooleanInput("pr_comment"),
github_actor: core.getInput("github_actor"),
github_token: core.getInput("github_token"),
// Inputs shared between buf steps.
input: core.getInput("input"),
paths: core.getMultilineInput("paths"),
Expand Down
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ import { parseModuleNames, ModuleName } from "./config";
// main is the entrypoint for the action.
async function main() {
const inputs = getInputs();
const github = getOctokit(core.getInput("github_token"));
const github = getOctokit(inputs.github_token);
const [bufPath, bufVersion] = await installBuf(github, inputs.version);
core.setOutput(Outputs.BufVersion, bufVersion);
if (inputs.github_actor == "dependabot[bot]") {
core.info("Skipping steps for dependabot");
return;
}
await login(bufPath, inputs);

if (inputs.setup_only) {
core.info("Setup only, skipping steps");
return;
Expand Down

0 comments on commit 980704f

Please sign in to comment.