diff --git a/gh-actions/rebuild.js b/gh-actions/rebuild.js index e8574e0..74266d5 100644 --- a/gh-actions/rebuild.js +++ b/gh-actions/rebuild.js @@ -1,6 +1,5 @@ -const { AUTHOR_EMAIL, AUTHOR_NAME, GITHUB_TOKEN, REF, REPO } = process.env - const { execSync } = require('child_process') +const { AUTHOR_EMAIL, AUTHOR_NAME, GITHUB_TOKEN, REF, REPO } = process.env const remoteUrl = `https://x-access-token:${GITHUB_TOKEN}@github.com/${REPO}.git` const branchName = REF.split('/')[2] @@ -23,11 +22,10 @@ if (getChangedFiles().includes('index.js')) { `git config user.name "${AUTHOR_NAME}"`, `git remote add gh-action ${remoteUrl}`, `git fetch gh-action ${branchName}`, - `git branch --set-upstream-to gh-action/${branchName}`, // push change `git add index.js`, `git commit -m "[gh-actions/rebuild] Rebuild index.js"`, - `git push`, + `git push gh-action HEAD:${branchName}`, ].join(' && ') ) } else {