Skip to content

Commit

Permalink
build: auth as both in release action
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Dec 4, 2023
1 parent c45cfda commit 2523582
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.DEPLOY_TOKEN }}
- uses: './.github/actions/release'
with:
gh_token: ${{ secrets.DEPLOY_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ function commitToPrevious(baseBranch: string, remote: string) {
const diffCommand = `git diff HEAD`;
const addCommand = `git add .`;
const commitToPreviousCommand = `git commit --no-edit -m "chore: [skip ci] sync dependencies"`;
// reset the original remote to allow bypass branch protection
const remoteCommand = 'git remote remove origin && git remote add origin https://${GH_TOKEN}@github.com/scalprum/scaffolding.git';
const pushCommand = `git push ${remote} ${baseBranch}`;
// check if there are any changes to be committed
const isDiff = execSync(diffCommand).toString().length > 0;
if (isDiff) {
execSync(remoteCommand);
execSync(addCommand);
execSync(commitToPreviousCommand);
execSync(pushCommand);
Expand Down

0 comments on commit 2523582

Please sign in to comment.