Skip to content

Commit

Permalink
chore: hacks semantic-release to skip verification of write access to…
Browse files Browse the repository at this point in the history
… git repo
  • Loading branch information
stalniy committed Sep 29, 2024
1 parent b6b2a17 commit bbb1d70
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dx/bin/release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ______HERE__

release_options=""
if [ "$preview_branch" != "" ]; then
release_options=" --dry-run --no-ci --branches master,$preview_branch"
release_options=" --dry-run --verify-conditions false --no-ci --branches master,$preview_branch"
fi
echo "running: pnpm run -r $pnpm_options release $release_options" >> $GITHUB_STEP_SUMMARY
pnpm run -r $pnpm_options release $release_options
Expand Down
13 changes: 13 additions & 0 deletions packages/dx/bin/semantic-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node


const git = require('semantic-release/lib/git');

// overwrite semantic release verifyAuth function to be ignored in dry-run mode
const verifyAuth = git.verifyAuth;
git.verifyAuth = async (...args) => {
if (process.argv.includes('--dry-run')) return;
return verifyAuth(...args);
}

require('semantic-release/bin/semantic-release.js');
8 changes: 7 additions & 1 deletion packages/dx/lib/dx.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const fsPath = require('path');
const fs = require('fs');
const { spawnAndExit } = require('./spawn');

const configPath = filename => fsPath.join(__dirname, '..', 'config', filename);
const localBin = cli => fsPath.join(__dirname, '..', 'node_modules', '.bin', cli);
const localBin = cli => {
const localReplacement = fsPath.join(__dirname, '..', 'bin', cli);
return fs.existsSync(localReplacement)
? localReplacement
: fsPath.join(__dirname, '..', 'node_modules', '.bin', cli);
}

const COMMANDS = {
install() {
Expand Down

0 comments on commit bbb1d70

Please sign in to comment.