Skip to content

Commit 8696afc

Browse files
Fix 403 on release creation by reordering publish steps (#552)
1 parent ac52338 commit 8696afc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

bin/publish.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def on_workflow_dispatch(version: str) -> None:
4848
update_action_yml(semver, digest)
4949
release_sha = git_commit(semver)
5050
repo = GH.get_repo(REPO)
51+
update_tags(release_sha)
52+
create_release(repo, release_sha)
53+
# Pin refs AFTER release creation: this commit modifies
54+
# .github/workflows/tagbot.yml, and pushing workflow file changes to the
55+
# default branch can cause GitHub to invalidate the running GITHUB_TOKEN.
5156
update_action_ref_pins(semver, release_sha)
5257
git("add", "--all")
5358
has_changes = (
@@ -59,8 +64,6 @@ def on_workflow_dispatch(version: str) -> None:
5964
if has_changes:
6065
git("commit", "--message", f"Pin action refs to v{semver}")
6166
git("push", "origin", "master")
62-
update_tags(release_sha)
63-
create_release(repo, release_sha)
6467
push_floating_tags()
6568

6669

0 commit comments

Comments
 (0)