Skip to content

Commit

Permalink
add commit sha entry
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-baez-seagull-com committed Mar 23, 2022
1 parent d98ffc5 commit 2c12f5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]> {
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,
Expand Down

0 comments on commit 2c12f5f

Please sign in to comment.