Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/scripts/dependabot_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ def eligible_commits(commits):
return False
types = re.findall(r"(?m)^ update-type: (\S+)\s*$", metadata[1])
dependencies = re.findall(r"(?m)^- dependency-name: ", metadata[1])

# Requirement-only bumps omit update-type; trust only the signed,
# single-dependency subject with an unambiguous same-major increase.
if not types and len(dependencies) == 1 and "update-type:" not in metadata[1]:
subject = data["message"].splitlines()[0]
bump = re.fullmatch(
r"(?:[\w()/-]+: )?update (\S+) requirement from "
r">=(\d+\.\d+\.\d+) to >=(\d+\.\d+\.\d+)", subject,
re.IGNORECASE)
name = re.search(r"(?m)^- dependency-name: (\S+)\s*$", metadata[1])
if bump and name and bump[1] == name[1]:
before = tuple(map(int, bump[2].split(".")))
after = tuple(map(int, bump[3].split(".")))
if after > before and after[0] == before[0]:
types = ["version-update:semver-minor"]
if not types or len(types) != len(dependencies):
return False
if any(t not in {"version-update:semver-patch",
Expand Down
18 changes: 18 additions & 0 deletions .github/scripts/test_dependabot_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ def test_unknown_update_type(self):
"version-update:semver-minor", "unknown")
self.assertFalse(eligible_commits([self.commit]))


def test_signed_requirement_bump_without_update_type(self):
self.commit["commit"]["message"] = (
"chore: update example requirement from >=7.6.0 to >=7.7.0\n\n"
"---\nupdated-dependencies:\n- dependency-name: example\n"
" dependency-type: direct:production\n...\n")
self.assertTrue(eligible_commits([self.commit]))
original = self.commit["commit"]["message"]
for old, new in [("7.7.0", "8.0.0"), ("7.7.0", "7.5.0"),
("7.7.0", "7.7.0rc1"), ("update example", "update other"),
(">=7.7.0", "<8"),
("...\n", " update-type: unknown\n...\n")]:
self.commit["commit"]["message"] = original.replace(old, new)
self.assertFalse(eligible_commits([self.commit]), new)
self.commit["commit"]["message"] = original
self.commit["commit"]["verification"]["verified"] = False
self.assertFalse(eligible_commits([self.commit]))

def test_empty_commits(self):
self.assertFalse(eligible_commits([]))

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: ./go.mod
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.13"
- name: Regression tests
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
# 不能用 `output/*` 之类的通配(会把 ./output/.git 也扫进来)。
- name: Publish GitHub Release
if: steps.delta.outputs.skip != '1'
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ env.RELEASE_TAG }}
name: GeoIP 产物(滚动更新)
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
# Seal is uploaded only after every binary/checksum upload succeeds.
- name: Publish release snapshot seal last
if: steps.delta.outputs.skip != '1'
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ env.RELEASE_TAG }}
files: output/snapshot-manifest.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Only trusted default-branch code receives the write token.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependency-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.13"
- run: python -m pip install -r requirements-ci.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-cnb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: 取出仓库
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
fetch-depth: 0
Expand Down
Loading