forked from dtinth/todo-actions
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge | |
}; | ||
Object.defineProperty(exports, "__esModule", ({ value: true })); | ||
exports.scanCodeRepository = exports.repoContext = void 0; | ||
const core_1 = __webpack_require__(6432); | ||
const fs_1 = __webpack_require__(5747); | ||
const tkt_1 = __webpack_require__(9508); | ||
const child_process_1 = __webpack_require__(3129); | ||
|
@@ -121,7 +122,8 @@ function scanCodeRepository() { | |
if (!process.env.GITHUB_TOKEN) { | ||
throw `Maybe you forgot to enable the GITHUB_TOKEN secret?`; | ||
} | ||
child_process_1.execSync('git push "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" HEAD:"$GITHUB_REF"', { stdio: 'inherit' }); | ||
const ref = core_1.getInput('branch') || "$GITHUB_REF"; | ||
child_process_1.execSync(`git push "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" HEAD:${ref}`, { stdio: 'inherit' }); | ||
}); | ||
}, | ||
}; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { getInput } from '@actions/core' | ||
import { existsSync, readFileSync } from 'fs' | ||
import { logger, invariant } from 'tkt' | ||
import { execSync, execFileSync } from 'child_process' | ||
|
@@ -79,8 +80,10 @@ export async function scanCodeRepository(): Promise<CodeRepositoryState> { | |
if (!process.env.GITHUB_TOKEN) { | ||
throw `Maybe you forgot to enable the GITHUB_TOKEN secret?` | ||
} | ||
|
||
const ref = getInput('branch') || "$GITHUB_REF" | ||
execSync( | ||
'git push "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" HEAD:"$GITHUB_REF"', | ||
`git push "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" HEAD:${ref}`, | ||
{ stdio: 'inherit' }, | ||
) | ||
}, | ||
|