[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]
pull/3087/head^2
David Sheldrick 2024-03-11 09:42:28 +00:00 zatwierdzone przez GitHub
rodzic a8b7d4e2d0
commit 464b1e9cab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

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

Wyświetl plik

@ -28,8 +28,9 @@ async function main() {
}
// we could probably do this a lot earlier in the yml file but 🤷‍♂️
await exec('git', ['fetch', 'origin', 'main'])
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) {