Skip to content

Commit 3dfd682

Browse files
committed
fix: Ensure hub-restyled is available during release.
When running the release script on CI, hub-restyled was missing from the PATH. We now download the hub-restyled script from hs-github-tools and updates look for it in the ci-tools/tools directory.
1 parent bd8b5ba commit 3dfd682

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎.github/workflows/release-deploy.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
- name: Link ci-tools
4949
if: github.repository == 'TokTok/ci-tools'
5050
run: ln -s .. third_party/ci-tools
51+
- name: Download hub-restyled
52+
run: |
53+
mkdir -p third_party/ci-tools/tools
54+
curl -sSL https://raw.githubusercontent.com/TokTok/hs-github-tools/master/tools/hub-restyled -o third_party/ci-tools/tools/hub-restyled
55+
chmod +x third_party/ci-tools/tools/hub-restyled
5156
- name: Create GitHub actions identity
5257
run: third_party/ci-tools/tools/use_github_actions_identity.sh
5358
- name: Set up git upstream remote

‎tools/create_release.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,11 @@ def stage_restyled(self, version: str, parent: stage.Stage) -> None:
617617
# Can't do this on CI.
618618
return
619619
with stage.Stage("Restyled", "Applying restyled fixes", parent=parent) as s:
620-
subprocess.run(["hub-restyled"], check=True) # nosec
620+
script_dir = os.path.dirname(os.path.realpath(__file__))
621+
hub_restyled = os.path.join(script_dir, "hub-restyled")
622+
if not os.path.exists(hub_restyled):
623+
hub_restyled = "hub-restyled"
624+
subprocess.run([hub_restyled], check=True) # nosec
621625
if self.git.is_clean():
622626
raise s.fail("Failed to apply restyled changes")
623627
self.git.add(".")

0 commit comments

Comments
 (0)