Skip to content

Commit e783c93

Browse files
committed
ci: add CodeQL actions language + presence-gate instant-sync dispatch
Addresses two further Hypatia workflow findings surfaced on the hardening PR: - codeql.yml (codeql_missing_actions_language): add `language: actions` so CodeQL also scans the GitHub Actions workflows themselves (build-mode none). - instant-sync.yml (secret_action_without_presence_gate): gate the repository-dispatch step on the token's presence. `secrets.*` is not usable in `if:`, so the secret is surfaced via a job-level env var and the step is skipped when the token is absent (forks / secret not configured) instead of failing. Behaviour is unchanged on the main repo where the secret is set. Left intentionally untouched: scorecard.yml's reusable-workflow permissions (the called workflow lives in hyperpolymath/standards, out of scope here, and is already being reworked on another branch) and the pre-existing code-safety findings (Idris2 believe_me axioms — deliberately kept and gated per #152; Agda funext postulate; ReScript Obj.magic; Rust FFI unsafe blocks), none of which are in this PR's diff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU
1 parent ba2cdbb commit e783c93

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ jobs:
3535
# was removed: the repo contains zero JS/TS sources (TypeScript/Node
3636
# are banned by the language policy), so CodeQL's JS/TS extractor
3737
# found no code and the job failed with a configuration error. `cpp`
38-
# covers the real C sources (Elixir NIF, OCaml/Lean wrapper, Zig FFI).
38+
# covers the real C sources (Elixir NIF, OCaml/Lean wrapper, Zig FFI);
39+
# `actions` scans the GitHub Actions workflows themselves.
3940
- language: cpp
4041
build-mode: none
42+
- language: actions
43+
build-mode: none
4144

4245
steps:
4346
- name: Checkout

.github/workflows/instant-sync.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ jobs:
1515
dispatch:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 15
18+
# Presence-gate the dispatch on the secret: `secrets.*` is not usable in
19+
# `if:`, so surface it via a job-level env var and skip the step when the
20+
# token is absent (forks / secret not configured) instead of failing.
21+
env:
22+
FARM_DISPATCH_TOKEN: ${{ secrets.FARM_DISPATCH_TOKEN }}
1823
steps:
1924
- name: Trigger Propagation
25+
if: ${{ env.FARM_DISPATCH_TOKEN != '' }}
2026
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v3
2127
with:
22-
token: ${{ secrets.FARM_DISPATCH_TOKEN }}
28+
token: ${{ env.FARM_DISPATCH_TOKEN }}
2329
repository: hyperpolymath/.git-private-farm
2430
event-type: propagate
2531
client-payload: |-

0 commit comments

Comments
 (0)