Skip to content

Commit 6121130

Browse files
committed
Remove temporary raw const
1 parent 9bdcc51 commit 6121130

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

check-cla/action.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,13 @@ runs:
7171
core.debug(`owner: ${owner}`);
7272
core.debug(`repo: ${repo}`);
7373
74-
const raw = await github.rest.repos.getContent({
74+
const { content, encoding } = (await github.rest.repos.getContent({
7575
owner: owner,
7676
repo: repo,
7777
path: '${{ inputs.cla_path }}'
78-
});
78+
})).data;
7979
const contributors = JSON.parse(
80-
Buffer.from(
81-
raw.data.content,
82-
raw.data.encoding
83-
).toString('utf-8')
80+
Buffer.from(content, encoding).toString('utf-8')
8481
).contributors;
8582
core.debug(`contributors: ${contributors}`);
8683

set-commit-status/action.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,22 @@ runs:
2828
github-token: ${{ inputs.token }}
2929
script: |
3030
const { owner, repo, number } = context.issue;
31-
const raw = await github.rest.pulls.get({
31+
const sha = (await github.rest.pulls.get({
3232
owner: owner,
3333
repo: repo,
3434
pull_number: number,
35-
});
36-
const sha = raw.data.head.sha;
35+
})).data.head.sha;
3736
core.debug(`owner: ${owner}`);
3837
core.debug(`repo: ${repo}`);
3938
core.debug(`sha: ${sha}`);
4039
41-
const raw = await github.rest.repos.createCommitStatus({
40+
const { context, state } = (await github.rest.repos.createCommitStatus({
4241
context: '${{ inputs.context }}',
4342
description: '${{ inputs.description }}',
4443
owner: owner,
4544
repo: repo,
4645
sha: sha,
4746
state: '${{ inputs.state }}',
4847
target_url: '${{ inputs.target_url }}'
49-
});
50-
core.info(`${raw.data.context} is ${raw.data.state}`);
48+
})).data;
49+
core.info(`${context} is ${state}`);

0 commit comments

Comments
 (0)