mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
ci: add option to skip status checks for releases
This commit is contained in:
parent
756c59103e
commit
420d7f1cea
2 changed files with 14 additions and 4 deletions
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
|
@ -4,9 +4,14 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'The version to release (major.minor.patch)'
|
||||
description: 'Version (major.minor.patch)'
|
||||
required: true
|
||||
type: string
|
||||
skip-branch-status-check:
|
||||
description: 'Skip CI status check.'
|
||||
default: false
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
|
@ -34,4 +39,4 @@ jobs:
|
|||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version-file: .github/python-version.txt
|
||||
- run: ./release/release.py ${{ inputs.version }}
|
||||
- run: ./release/release.py ${{ inputs.version }} ${{ inputs.skip-branch-status-check }}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ if __name__ == "__main__":
|
|||
assert re.match(r"^\d+\.\d+\.\d+$", version)
|
||||
major_version = int(version.split(".")[0])
|
||||
|
||||
skip_branch_status_check = sys.argv[2] == "true"
|
||||
|
||||
branch = subprocess.run(
|
||||
["git", "branch", "--show-current"],
|
||||
cwd=root, check=True, capture_output=True, text=True
|
||||
|
|
@ -45,8 +47,11 @@ if __name__ == "__main__":
|
|||
print("➡️ Working dir clean?")
|
||||
assert not subprocess.run(["git", "status", "--porcelain"]).stdout
|
||||
|
||||
print(f"➡️ CI is passing for {branch}?")
|
||||
assert get_json(f"https://api.github.com/repos/mitmproxy/mitmproxy/commits/{branch}/status")["state"] == "success"
|
||||
if skip_branch_status_check:
|
||||
print(f"⚠️ Skipping status check for {branch}.")
|
||||
else:
|
||||
print(f"➡️ CI is passing for {branch}?")
|
||||
assert get_json(f"https://api.github.com/repos/mitmproxy/mitmproxy/commits/{branch}/status")["state"] == "success"
|
||||
|
||||
print("➡️ Updating CHANGELOG.md...")
|
||||
changelog = root / "CHANGELOG.md"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue