Skip to content

Commit

Permalink
Fix publish failing due to tag push fail (#10767)
Browse files Browse the repository at this point in the history
* ensure origin master is tracked so pre push script works

* Release to npm is only accurate when closing a version packges pr. this is more accurate

* clear that it could do 1 of 2 things
  • Loading branch information
aaronmgdr authored Nov 21, 2023
1 parent e17d67c commit 6a63648
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/hooks/pre-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6a63648

Please sign in to comment.