Skip to content

Commit 855bc47

Browse files
authored
fix: reset in workflow should operate on registry.yaml and/or directories (#204)
1 parent 34e2b02 commit 855bc47

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/scheduled-jobs.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ on:
1313
- registry.yaml
1414
workflow_dispatch:
1515
inputs:
16-
reset:
17-
description: Space-separated paths to remove from schema before running an update
16+
reset-registry:
17+
description: Space-separated source keys to remove from registry.yaml
18+
default: ""
19+
type: string
20+
reset-paths:
21+
description: Space-separated directories to remove from schema and definitions
1822
default: ""
1923
type: string
2024

@@ -40,15 +44,22 @@ jobs:
4044
with:
4145
go-version-file: go.mod
4246

47+
- name: Optionally reset source registry
48+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.reset-registry != ''
49+
run: |
50+
for key in ${{ github.event.inputs.reset-registry }}; do
51+
yq "del(.sources[\"$key\"])" registry.yaml -i || true
52+
done
53+
4354
- name: Optionally remove paths
44-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.reset != ''
55+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.reset-paths != ''
4556
run: |
4657
cd schema
47-
rm -rf ${{ github.event.inputs.reset }} || true
58+
rm -rf ${{ github.event.inputs.reset-paths }} || true
4859
cd -
4960
5061
cd definitions
51-
rm -rf ${{ github.event.inputs.reset }} || true
62+
rm -rf ${{ github.event.inputs.reset-paths }} || true
5263
cd -
5364
5465
- name: Create token

0 commit comments

Comments
 (0)