Skip to content

Commit

Permalink
Remove temporary raw const
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Apr 5, 2023
1 parent 9bdcc51 commit 6121130
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
9 changes: 3 additions & 6 deletions check-cla/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ runs:
core.debug(`owner: ${owner}`);
core.debug(`repo: ${repo}`);
const raw = await github.rest.repos.getContent({
const { content, encoding } = (await github.rest.repos.getContent({
owner: owner,
repo: repo,
path: '${{ inputs.cla_path }}'
});
})).data;
const contributors = JSON.parse(
Buffer.from(
raw.data.content,
raw.data.encoding
).toString('utf-8')
Buffer.from(content, encoding).toString('utf-8')
).contributors;
core.debug(`contributors: ${contributors}`);
Expand Down
11 changes: 5 additions & 6 deletions set-commit-status/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,22 @@ runs:
github-token: ${{ inputs.token }}
script: |
const { owner, repo, number } = context.issue;
const raw = await github.rest.pulls.get({
const sha = (await github.rest.pulls.get({
owner: owner,
repo: repo,
pull_number: number,
});
const sha = raw.data.head.sha;
})).data.head.sha;
core.debug(`owner: ${owner}`);
core.debug(`repo: ${repo}`);
core.debug(`sha: ${sha}`);
const raw = await github.rest.repos.createCommitStatus({
const { context, state } = (await github.rest.repos.createCommitStatus({
context: '${{ inputs.context }}',
description: '${{ inputs.description }}',
owner: owner,
repo: repo,
sha: sha,
state: '${{ inputs.state }}',
target_url: '${{ inputs.target_url }}'
});
core.info(`${raw.data.context} is ${raw.data.state}`);
})).data;
core.info(`${context} is ${state}`);

0 comments on commit 6121130

Please sign in to comment.