Skip to content

Commit 8c6ccb3

Browse files
committed
ci: run checks in weekly lockfile update workflow
PRs created by the weekly lockfile update workflow use the default GITHUB_TOKEN via peter-evans/create-pull-request. GitHub does not trigger pull_request workflows for PRs created this way, so the CI workflow (and its all-green job) never runs, blocking merge. Fix by having the lockfile update workflow call shared.yml directly after creating the PR, producing its own all-green status check. Changes: - Add optional ref input to shared.yml for explicit checkout control - Run shared checks against the weekly-lockfile-update branch - Gate checks on a PR actually being created - Add all-green job matching the required status check
1 parent d77292f commit 8c6ccb3

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/shared.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Shared Checks
22

33
on:
44
workflow_call:
5+
inputs:
6+
ref:
7+
description: "Git ref to checkout (defaults to the triggering event ref)"
8+
required: false
9+
type: string
10+
default: ""
511

612
permissions:
713
contents: read
@@ -14,6 +20,8 @@ jobs:
1420
runs-on: ubuntu-latest
1521
steps:
1622
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
with:
24+
ref: ${{ inputs.ref || github.sha }}
1725

1826
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
1927
with:
@@ -45,6 +53,8 @@ jobs:
4553

4654
steps:
4755
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56+
with:
57+
ref: ${{ inputs.ref || github.sha }}
4858

4959
- name: Install uv
5060
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
@@ -66,6 +76,8 @@ jobs:
6676
runs-on: ubuntu-latest
6777
steps:
6878
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
79+
with:
80+
ref: ${{ inputs.ref || github.sha }}
6981

7082
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
7183
with:

.github/workflows/weekly-lockfile-update.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ permissions:
1313
jobs:
1414
update-lockfile:
1515
runs-on: ubuntu-latest
16+
outputs:
17+
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}
1618
steps:
1719
- uses: actions/checkout@v6.0.1
1820

@@ -29,6 +31,7 @@ jobs:
2931
echo '```' >> pr_body.md
3032
3133
- name: Create pull request
34+
id: create-pr
3235
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v7
3336
with:
3437
commit-message: "chore: update uv.lock with latest dependencies"
@@ -38,3 +41,20 @@ jobs:
3841
delete-branch: true
3942
add-paths: uv.lock
4043
labels: dependencies
44+
45+
checks:
46+
if: needs.update-lockfile.outputs.pull-request-number
47+
needs: [update-lockfile]
48+
uses: ./.github/workflows/shared.yml
49+
with:
50+
ref: weekly-lockfile-update
51+
52+
all-green:
53+
if: always()
54+
needs: [update-lockfile, checks]
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
58+
with:
59+
jobs: ${{ toJSON(needs) }}
60+
allowed-skips: checks

0 commit comments

Comments
 (0)