Skip to content

Commit

Permalink
fix: clean workDirectory before cloning private action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Fields committed Mar 10, 2020
1 parent 9e4b9c4 commit b9736ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12065,6 +12065,8 @@ function runAction(opts) {
core.startGroup('Cloning private action');
repoUrl = "https://" + opts.token + "@github.com/" + repo + ".git";
cmd = ['git clone', repoUrl, opts.workDirectory].join(' ');
core.info("Cleaning workDirectory");
rimraf_1.sync(opts.workDirectory);
core.info("Cloning action from https://***TOKEN***@github.com/" + repo + ".git" + (sha ? " (SHA: " + sha + ")" : ''));
return [4 /*yield*/, exec.exec(cmd)];
case 1:
Expand Down
3 changes: 3 additions & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export async function runAction(opts: {
const repoUrl = `https://${opts.token}@github.com/${repo}.git`;
const cmd = ['git clone', repoUrl, opts.workDirectory].join(' ');

core.info(`Cleaning workDirectory`);
sync(opts.workDirectory);

core.info(
`Cloning action from https://***TOKEN***@github.com/${repo}.git${sha ? ` (SHA: ${sha})` : ''}`
);
Expand Down

0 comments on commit b9736ee

Please sign in to comment.