Skip to content

Commit

Permalink
Fix rebuild script
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdothtml committed Oct 27, 2019
1 parent ef516ca commit c47f4e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gh-actions/rebuild.js
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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 {
Expand Down

0 comments on commit c47f4e4

Please sign in to comment.