Skip to content

Commit a5008a1

Browse files
committed
feat(ci): update paths in CI workflow and enhance refresh workflow with input options
1 parent 05b6a0c commit a5008a1

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ on:
77
- main
88
paths: &paths
99
- .github/workflows/ci.yaml
10-
- cmd/**
10+
- "**/*.go"
1111
- docker-bake.hcl
1212
- Dockerfile
1313
- go.mod
1414
- go.sum
15-
- main.go
1615
pull_request:
1716
branches:
1817
- main

.github/workflows/refresh.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ name: refresh
55
# topological order (parents before children).
66
on:
77
workflow_dispatch:
8+
inputs:
9+
build:
10+
description: "Dispatch builds for outdated targets (always on for scheduled runs)."
11+
type: boolean
12+
default: true
813
schedule:
914
- cron: "0 6 * * *" # daily at 06:00 UTC
1015

1116
permissions:
1217
contents: read
18+
actions: write # required to dispatch build.yaml
1319

1420
jobs:
15-
plan:
21+
refresh:
1622
runs-on: ubuntu-latest
17-
outputs:
18-
# JSON array of node ids (target references) in topological order.
19-
targets: ${{ steps.outdated.outputs.targets }}
20-
count: ${{ steps.outdated.outputs.count }}
2123
steps:
2224
- uses: actions/checkout@v6
2325

@@ -50,19 +52,16 @@ jobs:
5052
name: graph
5153
path: graph.json
5254

53-
dispatch:
54-
needs: plan
55-
if: needs.plan.outputs.count != '0'
56-
runs-on: ubuntu-latest
57-
permissions:
58-
contents: read
59-
actions: write # required to dispatch build.yaml
60-
steps:
6155
- name: Dispatch builds in topological order
56+
# Scheduled runs always build; manual runs build only when requested, so a
57+
# workflow_dispatch can be used to inspect the plan artifact without building.
58+
if: >-
59+
steps.outdated.outputs.count != '0' &&
60+
(github.event_name == 'schedule' || inputs.build)
6261
env:
6362
GH_TOKEN: ${{ github.token }}
6463
REF: ${{ github.ref_name }}
65-
TARGETS: ${{ needs.plan.outputs.targets }}
64+
TARGETS: ${{ steps.outdated.outputs.targets }}
6665
run: |
6766
# Dispatch each build sequentially and wait for it to finish before
6867
# the next, so an internal base is pushed before its dependents build.

0 commit comments

Comments
 (0)