Fix default branch name bit of update workflow (#189)

This commit is contained in:
Patrick Stevens
2024-07-12 17:22:07 +01:00
committed by GitHub
parent ffaa373da9
commit 2c7cd91cbc
2 changed files with 5 additions and 4 deletions

View File

@@ -21,9 +21,9 @@ if not GITHUB_TOKEN:
REPO = os.environ.get("GITHUB_REPOSITORY")
if not REPO:
raise Exception("Supply GITHUB_REPOSITORY env var")
GITHUB_BASE_REF = os.environ.get("GITHUB_BASE_REF") or ""
if not GITHUB_BASE_REF:
raise Exception("Supply GITHUB_BASE_REF env var")
DEFAULT_BRANCH = os.environ.get("DEFAULT_BRANCH") or ""
if not DEFAULT_BRANCH:
raise Exception("Supply DEFAULT_BRANCH env var")
GITHUB_OUTPUT = os.environ.get("GITHUB_OUTPUT") or ""
if not GITHUB_OUTPUT:
raise Exception("Supply GITHUB_OUTPUT env var")
@@ -155,7 +155,7 @@ def main():
create_branch(branch_name, new_commit_sha)
print(f"Branch created: {branch_name}")
url, pr_num = create_pull_request(title="Upgrade Nix flake and deps", branch_name=branch_name, base_branch=GITHUB_BASE_REF)
url, pr_num = create_pull_request(title="Upgrade Nix flake and deps", branch_name=branch_name, base_branch=DEFAULT_BRANCH)
print(f"See PR at: {url}")
with open(GITHUB_OUTPUT, "a") as output_file:

View File

@@ -46,6 +46,7 @@ jobs:
- name: Create pull request
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
BEARER_TOKEN: ${{ steps.generate-token.outputs.token }}
run: /tmp/venv/bin/python .github/workflows/commit.py