Skip to content

Commit f052835

Browse files
authored
Merge pull request #4 from techofourown/codex/catalog-refresh-apps-demo-20260315
Trigger catalog refresh after apps-demo image publish
2 parents 9054865 + 44c9ac0 commit f052835

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
- uses: rhysd/actionlint@v1.7.11
1415
- name: Validate script syntax
15-
run: bash -n scripts/check-apps-manifest.sh scripts/check-app-builds.sh
16+
run: bash -n scripts/check-apps-manifest.sh scripts/check-app-builds.sh scripts/check-workflow-guards.sh
17+
- name: Validate workflow guards
18+
run: bash scripts/check-workflow-guards.sh
1619
- name: Validate manifest and source layout
1720
run: bash scripts/check-apps-manifest.sh
1821
- name: Build application images

.github/workflows/publish-images.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,22 @@ jobs:
9797
with:
9898
name: ${{ matrix.app_id }}-publish-record
9999
path: dist/${{ matrix.app_id }}.publish-record.json
100+
101+
refresh-catalogs:
102+
needs: publish
103+
runs-on: ubuntu-latest
104+
env:
105+
CATALOG_REFRESH_TOKEN: ${{ secrets.CATALOG_REFRESH_TOKEN }}
106+
steps:
107+
- name: Trigger downstream catalog refresh
108+
if: ${{ env.CATALOG_REFRESH_TOKEN != '' }}
109+
run: |
110+
set -euo pipefail
111+
for repo in sw-ourbox-catalog-demo; do
112+
curl -fsSL \
113+
-X POST \
114+
-H "Accept: application/vnd.github+json" \
115+
-H "Authorization: Bearer ${CATALOG_REFRESH_TOKEN}" \
116+
"https://api.github.com/repos/techofourown/${repo}/dispatches" \
117+
-d "{\"event_type\":\"refresh-from-upstream-image-publish\",\"client_payload\":{\"source_repo\":\"${GITHUB_REPOSITORY}\",\"source_sha\":\"${GITHUB_SHA}\"}}"
118+
done

scripts/check-workflow-guards.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
6+
matches="$(grep -RInE '^[[:space:]]*if:.*\bsecrets\.' "${ROOT}/.github/workflows" || true)"
7+
if [[ -n "${matches}" ]]; then
8+
echo "workflow if conditions must not reference secrets.* directly" >&2
9+
echo "${matches}" >&2
10+
exit 1
11+
fi
12+
13+
echo "Workflow guard checks passed."

0 commit comments

Comments
 (0)