[infra] Fix patch release script (#3095)

Need to make sure we have access to the `main` branch so we can
calculate how many commits the branch has diverged by.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package[^2]
This commit is contained in:
David Sheldrick 2024-03-11 09:42:28 +00:00 committed by GitHub
parent a8b7d4e2d0
commit 464b1e9cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -172,8 +172,8 @@ export async function publish(distTag?: string) {
} }
}, },
{ {
delay: 3000, delay: 4000,
numAttempts: 10, numAttempts: 20,
} }
) )
} }

View file

@ -28,8 +28,9 @@ async function main() {
} }
// we could probably do this a lot earlier in the yml file but 🤷‍♂️ // we could probably do this a lot earlier in the yml file but 🤷‍♂️
await exec('git', ['fetch', 'origin', 'main'])
const numberOfCommitsSinceBranch = Number( const numberOfCommitsSinceBranch = Number(
(await exec('git', ['rev-list', '--count', `HEAD`, '^main'])).toString().trim() (await exec('git', ['rev-list', '--count', `HEAD`, '^origin/main'])).toString().trim()
) )
if (numberOfCommitsSinceBranch === 0) { if (numberOfCommitsSinceBranch === 0) {