Skip to content

Commit 953cb8a

Browse files
committed
Guard the dispatch jobs against forks, not the lint
titanium-sdk carried `github.repository_owner == 'tidev'` and the module repos did not -- an inherited asymmetry, not a decision. Worse, this branch had it on the wrong job: once notify stopped depending on lint, guarding lint stopped guarding anything. A fork would skip the one job that is useful there and still run both dispatch jobs, which fail because a fork holds no dispatch token. The guard now sits on the two jobs that reach outside the repo, in all 17 repos. Forks lint their own apidoc changes, which is worth having, and produce no failing dispatch runs. It is about noise, not security. A fork has no REGEN_DOCS_GITHUB_TOKEN, and even with one the payload names the fork, which is not on titanium-www's allowlist -- that allowlist is the actual boundary.
1 parent f277a97 commit 953cb8a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/regen-docs.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ jobs:
4242
# ti.coremotion cannot run `npm ci` at all today because its lockfile is out of
4343
# sync with its package.json. Genuinely malformed apidoc still cannot ship: the
4444
# compile in titanium-www fails on it and commits nothing.
45-
#
46-
# Skipped on pull_request: a proposed change gets linted, not published.
4745
notify:
48-
if: github.event_name != 'pull_request'
46+
# Skipped on pull_request: a proposed change gets linted, not published.
47+
# Skipped in forks: they hold no dispatch token, so this would only ever
48+
# produce a failing run. The allowlist in titanium-www is the actual
49+
# boundary -- a fork's payload names the fork, which is not on it.
50+
if: github.event_name != 'pull_request' && github.repository_owner == 'tidev'
4951
uses: tidev/titanium-www/.github/workflows/notify-api-docs.yml@main
5052
secrets:
5153
dispatch-token: ${{ secrets.REGEN_DOCS_GITHUB_TOKEN }}
@@ -57,7 +59,11 @@ jobs:
5759
#
5860
# Delete this job once titaniumsdk.com is served from titanium-www (TI-52).
5961
notify-legacy:
60-
if: github.event_name != 'pull_request'
62+
# Skipped on pull_request: a proposed change gets linted, not published.
63+
# Skipped in forks: they hold no dispatch token, so this would only ever
64+
# produce a failing run. The allowlist in titanium-www is the actual
65+
# boundary -- a fork's payload names the fork, which is not on it.
66+
if: github.event_name != 'pull_request' && github.repository_owner == 'tidev'
6167
runs-on: ubuntu-latest
6268
name: Notify titanium-docs (legacy)
6369
steps:

0 commit comments

Comments
 (0)