Commit c56e237
committed
ci: make CI fork-friendly when DEPLOY_KEY secret is absent
The fork's CI has never run (`gh api repos/quangdang46/jcode/actions/runs`
returns total_count=0 for both pull_request and push events) because
upstream's workflows assume a `DEPLOY_KEY` SSH secret that the fork
does not have.
Two changes:
1. Gate every `webfactory/ssh-agent@v0.9.0` step on
`if: ${{ secrets.DEPLOY_KEY != '' }}` so the SSH agent setup is
simply skipped when the secret is absent. This is safe here because
none of this fork's Cargo git dependencies use SSH URLs:
- `agentgrep` -> https://github.com/1jehuang/agentgrep.git
- `mermaid-rs-renderer` -> https://github.com/1jehuang/mermaid-rs-renderer.git
So the `actions/checkout@v4` step's empty `ssh-key` falls back to
the GITHUB_TOKEN HTTPS path automatically. Applies to 5 jobs in
ci.yml + 1 step in release.yml.
2. Add `workflow_dispatch:` to ci.yml so maintainers can trigger CI
manually from the Actions tab while debugging without having to
force-push a no-op commit.
Note for the fork owner: GitHub disables Actions on a freshly-forked
repo until you visit the Actions tab once and click 'I understand my
workflows, go ahead and enable them'. After this PR is merged AND the
fork's Actions are enabled, future PRs will automatically run CI.
Refs the absence of CI runs blocking PRs quangdang46#174-quangdang46#195.1 parent c3f63b3 commit c56e237
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
| 216 | + | |
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
| |||
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| 388 | + | |
383 | 389 | | |
384 | 390 | | |
385 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments