Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Sep 30, 2024
1 parent 907080b commit ebcf660
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27394,13 +27394,16 @@ git checkout ${process.env.GITHUB_REF_NAME}`)
}
} else {
core.debug(`Initializing git repository at "${sourcePath}"`)
// Custom git init requires own authorization setup (inspired from actions/checkout)
const repoUrl = new URL(REPO_URL)
repoUrl.username = 'x-access-token'
repoUrl.password = ghToken
if (dryRun) {
core.info(`\
[dry run]
git init -b ${targetBranch}
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config http.${process.env.GITHUB_SERVER_URL}/.extraheader AUTHORIZATION: basic ***
git add .
git commit -m "Sync"
git remote add origin ${REPO_URL}
Expand All @@ -27410,12 +27413,9 @@ git push -f origin HEAD:${targetBranch}`)
await index_x('git', ['config', 'user.name', 'github-actions[bot]'])
// prettier-ignore
await index_x('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com'])
// Custom git init requires own authorization setup (inspired from actions/checkout)
// prettier-ignore
await index_x('git', ['config', `http.${process.env.GITHUB_SERVER_URL}/.extraheader`, `AUTHORIZATION: basic ${ghToken}`])
await index_x('git', ['add', '.'])
await index_x('git', ['commit', '-m', 'Sync'])
await index_x('git', ['remote', 'add', 'origin', REPO_URL])
await index_x('git', ['remote', 'add', 'origin', repoUrl])
core.debug(`Force pushing to "${targetBranch}" branch`)
await index_x('git', ['push', '-f', 'origin', `HEAD:${targetBranch}`])
await promises_namespaceObject.rm(gitDir, { recursive: true, force: true })
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ git checkout ${process.env.GITHUB_REF_NAME}`)
}
} else {
core.debug(`Initializing git repository at "${sourcePath}"`)
// Custom git init requires own authorization setup (inspired from actions/checkout)
const repoUrl = new URL(REPO_URL)
repoUrl.username = 'x-access-token'
repoUrl.password = ghToken
if (dryRun) {
core.info(`\
[dry run]
git init -b ${targetBranch}
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config http.${process.env.GITHUB_SERVER_URL}/.extraheader AUTHORIZATION: basic ***
git add .
git commit -m "Sync"
git remote add origin ${REPO_URL}
Expand All @@ -137,12 +140,9 @@ git push -f origin HEAD:${targetBranch}`)
await x('git', ['config', 'user.name', 'github-actions[bot]'])
// prettier-ignore
await x('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com'])
// Custom git init requires own authorization setup (inspired from actions/checkout)
// prettier-ignore
await x('git', ['config', `http.${process.env.GITHUB_SERVER_URL}/.extraheader`, `AUTHORIZATION: basic ${ghToken}`])
await x('git', ['add', '.'])
await x('git', ['commit', '-m', 'Sync'])
await x('git', ['remote', 'add', 'origin', REPO_URL])
await x('git', ['remote', 'add', 'origin', repoUrl])
core.debug(`Force pushing to "${targetBranch}" branch`)
await x('git', ['push', '-f', 'origin', `HEAD:${targetBranch}`])
await fs.rm(gitDir, { recursive: true, force: true })
Expand Down
2 changes: 1 addition & 1 deletion test-fixtures/file.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
console.log('file')
console.log('test-fixture-file')

0 comments on commit ebcf660

Please sign in to comment.