Skip to content

Commit

Permalink
use sha instead of ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Obi-Dann committed Apr 13, 2021
1 parent d53a465 commit 7b22976
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function getRunContext() {
const { pull_request: { number: pullRequestNumber, base: { sha: baseSha } } } = pullRequestPayload;
return {
baseRef: baseSha,
headRef: lib_github.context.ref,
headRef: lib_github.context.sha,
pullRequestNumber,
repo
};
Expand Down Expand Up @@ -405,20 +405,20 @@ var main_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arg
function run() {
return main_awaiter(this, void 0, void 0, function* () {
try {
const { baseRef: baseSha, headRef: headSha, pullRequestNumber, repo } = getRunContext();
const { baseRef, headRef, pullRequestNumber, repo } = getRunContext();
const token = core.getInput('token');
core.info(`Configuring renovate`);
const { config, git } = yield getRenovateConfig(Object.assign(Object.assign({}, repo), { token }));
core.info(`Checking out PR base sha ${baseSha}`);
yield git.fetch(['origin', '--depth=1', baseSha]);
yield git.checkout(baseSha);
core.info(`Checking out PR base sha ${baseRef}`);
yield git.fetch(['origin', '--depth=1', baseRef]);
yield git.checkout(baseRef);
core.info(`Looking for all dependencies in base`);
const baseDependencies = yield (0,extract.extractAllDependencies)(config);
core.info(`Fetching possible updates for all base ref dependencies`);
yield (0,fetch.fetchUpdates)(config, baseDependencies);
core.info(`Checking out PR head sha ${headSha}`);
yield git.fetch(['origin', '--depth=1', headSha]);
yield git.checkout(headSha);
core.info(`Checking out PR head sha ${headRef}`);
yield git.fetch(['origin', '--depth=1', headRef]);
yield git.checkout(headRef);
core.info(`Looking for all dependencies in head`);
const headDependencies = yield (0,extract.extractAllDependencies)(config);
const updatedDependencies = [
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/getRunContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getRunContext(): RunContext {
} = pullRequestPayload
return {
baseRef: baseSha,
headRef: context.ref,
headRef: context.sha,
pullRequestNumber,
repo
}
Expand Down

0 comments on commit 7b22976

Please sign in to comment.