diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9dc05cac14a..f35eca07970 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,7 +11,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: release: - name: Release to NPM + name: Prepare or Publish runs-on: ['self-hosted', 'org', 'npm-publish'] permissions: contents: write diff --git a/scripts/hooks/pre-push.js b/scripts/hooks/pre-push.js index 0c38945c79b..8596ef2de3a 100644 --- a/scripts/hooks/pre-push.js +++ b/scripts/hooks/pre-push.js @@ -60,7 +60,13 @@ function getDateFromFirstCommit(fromSHA, toSHA) { //////////////////////////////////////////////////////////////// // must trim otherwise the name will be 'origin\n' + const remoteName = execSync('git remote').toString().trim() +// create remote tracking branches to ensure we can compare current to origin/master +const remoteTrackingMasterBranches = execSync('git ls-remote --heads origin master') +if (remoteTrackingMasterBranches.toString().trim() === '') { + execSync('git fetch origin') +} const changes = process.env.HUSKY_GIT_STDIN.split('\n') .filter((line) => line !== '') .map((line) => {