From c56e237848f72d16f46b5d2d6458fd319c2453a7 Mon Sep 17 00:00:00 2001 From: quangdang46 Date: Fri, 22 May 2026 10:23:37 +0700 Subject: [PATCH] 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 #174-#195. --- .github/workflows/ci.yml | 6 ++++++ .github/workflows/release.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a22172ac..7e5a94cd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [main, master] pull_request: branches: [main, master] + workflow_dispatch: concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} @@ -26,6 +27,7 @@ jobs: submodules: recursive - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }} @@ -79,6 +81,7 @@ jobs: submodules: recursive - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }} @@ -120,6 +123,7 @@ jobs: submodules: recursive - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }} @@ -209,6 +213,7 @@ jobs: submodules: recursive - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }} @@ -380,6 +385,7 @@ jobs: submodules: recursive - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c42cf581..6013511aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,7 @@ jobs: fetch-depth: 0 - name: Configure SSH for cargo git dependencies + if: ${{ secrets.DEPLOY_KEY != '' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DEPLOY_KEY }}