From 2c12f5f044d4d32649cf6f4dc2d75085d0428ef2 Mon Sep 17 00:00:00 2001 From: Ruben Date: Tue, 22 Mar 2022 21:35:02 -0500 Subject: [PATCH] add commit sha entry --- action.yml | 3 +++ src/index.ts | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index f8dcd87..fa6f6bc 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,9 @@ inputs: github-token: description: 'The repository token, i.e. secrets.GITHUB_TOKEN' required: true + commit-sha: + description: 'Commit sha' + required: true outputs: result: description: Labels of PR diff --git a/src/index.ts b/src/index.ts index b12f7e1..11cd9a5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,19 +12,21 @@ import { async function run() { const token = getInput("github-token", { required: true }); + const sha = getInput("commit-sha", { required: true }); const client = new GitHub(token); - const labelNames = await getLabels(client); + const labelNames = await getLabels(client, sha); setOutput("result", labelNames); } async function getLabels( - client: GitHub + client: GitHub, + sha: string ): Promise { const owner = context.repo.owner; const repo = context.repo.repo; - const commit_sha = context.sha; + const commit_sha = sha; const response = await client.repos.listPullRequestsAssociatedWithCommit({ owner,