Skip to content

Commit

Permalink
chore: add debug log.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 6, 2021
1 parent c6d4178 commit 5e3c684
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ async function run() {


if (!baseRef) {
const latestRelease = await octokit.repos.getLatestRelease({
owner: owner,
repo: repo
});
const latestRelease = await octokit.repos.getLatestRelease({ ...github.context.repo });
if (latestRelease.status !== 200) {
core.setFailed(
`There are no releases on ${owner}/${repo}. Tags are not releases. (status=${latestRelease.status}) ${latestRelease.data.message || ''}`
Expand Down Expand Up @@ -66,6 +63,8 @@ async function run() {
}
var baseHash = latestRef.data.object.sha;

core.info(`Latest Ref: \x1b[34m${JSON.stringify(latestRef.data)}\x1b[0m`)

// By default a GitHub action checkout is shallow. Get all the tags, branches,
// and history. Redirect output to standard error which we can collect in the
// action.
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ async function run() {


if (!baseRef) {
const latestRelease = await octokit.repos.getLatestRelease({
owner: owner,
repo: repo
});
const latestRelease = await octokit.repos.getLatestRelease({ ...github.context.repo });
if (latestRelease.status !== 200) {
core.setFailed(
`There are no releases on ${owner}/${repo}. Tags are not releases. (status=${latestRelease.status}) ${latestRelease.data.message || ''}`
Expand Down Expand Up @@ -59,6 +56,8 @@ async function run() {
}
var baseHash = latestRef.data.object.sha;

core.info(`Latest Ref: \x1b[34m${JSON.stringify(latestRef.data)}\x1b[0m`)

// By default a GitHub action checkout is shallow. Get all the tags, branches,
// and history. Redirect output to standard error which we can collect in the
// action.
Expand Down

0 comments on commit 5e3c684

Please sign in to comment.