-
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 2.22 KB
/
Copy pathboj-build.yml
File metadata and controls
62 lines (55 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
#
# OPTIONAL: BoJ Server Build Trigger
# This workflow notifies a BoJ Server instance when code is pushed.
# It is a no-op if BOJ_SERVER_URL is not set or the server is unreachable.
# To enable: set BOJ_SERVER_URL as a repository secret or variable.
# To disable: delete this file or leave BOJ_SERVER_URL unset.
name: BoJ Server Build Trigger
on:
push:
branches: [main, master]
workflow_dispatch:
permissions:
contents: read
jobs:
trigger-boj:
runs-on: ubuntu-latest
# No job-level `if:` here. It previously read
#
# #
# and `secrets` is not available in a job-level conditional — GitHub exposes
# that context only in `env:`, `with:` and step-level expressions. The file
# is valid YAML, so nothing local caught it, but Actions rejected the whole
# workflow at load time: every run failed in 0s, named after the file path
# rather than "BoJ Server Build Trigger", with no jobs and no check run.
# That is the startup_failure signature.
#
# Guarding here was redundant anyway: the step below already exits 0 when
# BOJ_URL is empty, and `vars`/`secrets` are resolved there legally. This
# workflow is documented as a no-op when BOJ_SERVER_URL is unset, and now
# it actually is one instead of failing the run.
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Trigger BoJ Server (Casket/ssg-mcp)
env:
BOJ_URL: ${{ secrets.BOJ_SERVER_URL || vars.BOJ_SERVER_URL }}
REPO_NAME: ${{ github.repository }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
if [ -z "$BOJ_URL" ]; then
echo "BOJ_SERVER_URL not configured - skipping"
exit 0
fi
payload="$(jq -cn \
--arg repo "$REPO_NAME" \
--arg branch "$BRANCH_NAME" \
--arg engine "casket" \
'{repo:$repo, branch:$branch, engine:$engine}')"
curl -sf -X POST "${BOJ_URL}/cartridges/ssg-mcp/invoke" \
-H "Content-Type: application/json" \
--data "$payload" \
|| echo "BoJ server unreachable - skipping (non-fatal)"