Repository: denoland/deno
Pull request: ci: fix release rebuilding on prs

```
4.742792421s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint: stale: changed env "DENO_CANARY"
   4.742813943s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint:        Some("true") != None
   4.749316937s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint: fingerprint dirty for deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli)/Build/TargetInner { name: "deno", ..: with_path("/home/admin/actions-runner/_work/deno/deno/cli/main.rs", Edition2024) }
   4.749333660s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint:     dirty: UnitDependencyInfoChanged { old_name: "deno", old_fingerprint: 2359346565633703518, new_name: "deno", new_fingerprint: 9777391287068413100 }
   4.757936669s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint: fingerprint dirty for deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli)/Build/TargetInner { name_inferred: true, ..: lib_target("deno", ["lib"], "/home/admin/actions-runner/_work/deno/deno/cli/lib.rs", Edition2024) }
   4.757951347s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="deno"}: cargo::core::compiler::fingerprint:     dirty: UnitDependencyInfoChanged { old_name: "build_script_build", old_fingerprint: 5936696904586838552, new_name: "build_script_build", new_fingerprint: 5497818987856589099 }
   4.760464870s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="build-script-build"}: cargo::core::compiler::fingerprint: fingerprint dirty for deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli)/RunCustomBuild/TargetInner { ..: custom_build_target("build-script-build", "/home/admin/actions-runner/_work/deno/deno/cli/build.rs", Edition2024) }
   4.760474398s  INFO prepare_target{force=false package_id=deno v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli) target="build-script-build"}: cargo::core::compiler::fingerprint:     dirty: EnvVarChanged { name: "DENO_CANARY", old_value: Some("true"), new_value: None }
   4.797389968s  INFO prepare_target{force=false package_id=deno_lib v0.50.0 (/home/admin/actions-runner/_work/deno/deno/cli/lib) target="deno_lib"}: cargo::core::compiler::fingerprint: fingerprint dirty for deno_lib v0.50.0 (/home/admin/actions-runner/_work/deno/deno/cli/lib)/Build/TargetInner { name_inferred: true, ..: lib_target("deno_lib", ["lib"], "/home/admin/actions-runner/_work/deno/deno/cli/lib/lib.rs", Edition2024) }
   4.797408775s  INFO prepare_target{force=false package_id=deno_lib v0.50.0 (/home/admin/actions-runner/_work/deno/deno/cli/lib) target="deno_lib"}: cargo::core::compiler::fingerprint:     dirty: FsStatusOutdated(StaleItem(ChangedEnv { var: "DENO_CANARY", previous: Some("true"), current: None }))
   4.821441353s  INFO prepare_target{force=false package_id=denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt) target="denort"}: cargo::core::compiler::fingerprint: fingerprint dirty for denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt)/Build/TargetInner { name: "denort", ..: with_path("/home/admin/actions-runner/_work/deno/deno/cli/rt/main.rs", Edition2024) }
   4.821459728s  INFO prepare_target{force=false package_id=denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt) target="denort"}: cargo::core::compiler::fingerprint:     dirty: FsStatusOutdated(StaleDepFingerprint { name: "deno_lib" })
   4.824265515s  INFO prepare_target{force=false package_id=denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt) target="denort"}: cargo::core::compiler::fingerprint: fingerprint dirty for denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt)/Build/TargetInner { name_inferred: true, ..: lib_target("denort", ["lib"], "/home/admin/actions-runner/_work/deno/deno/cli/rt/lib.rs", Edition2024) }
   4.824283981s  INFO prepare_target{force=false package_id=denort v2.6.10 (/home/admin/actions-runner/_work/deno/deno/cli/rt) target="denort"}: cargo::core::compiler::fingerprint:     dirty: FsStatusOutdated(StaleDepFingerprint { name: "deno_lib" })
```

Fixed in this PR:

<img width="464" height="84" alt="image" src="https://github.com/user-attachments/assets/3fdcdca5-1151-405e-b54c-8c3ba72b3f07" />


Changed files:
filename: .github/workflows/ci.generate.ts
patch: @@ -769,8 +769,8 @@ const buildJobs = buildItems.map((rawBuildItem) => {
             sysRootStep,
           )(
             {
+              // do this on PRs as well as main so that PRs can use the cargo build cache from main
               name: "Configure canary build",
-              if: isMainBranch,
               run: 'echo "DENO_CANARY=true" >> $GITHUB_ENV',
             },
             {

filename: .github/workflows/ci.yml
patch: @@ -587,7 +587,7 @@ jobs:
       - uses: dsherret/rust-toolchain-file@v1
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
       - name: Configure canary build
-        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
+        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
@@ -1384,7 +1384,7 @@ jobs:
       - uses: dsherret/rust-toolchain-file@v1
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
       - name: Configure canary build
-        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
+        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
@@ -2111,7 +2111,7 @@ jobs:
       - uses: dsherret/rust-toolchain-file@v1
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
       - name: Configure canary build
-        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
+        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
@@ -2764,7 +2764,7 @@ jobs:
       - uses: dsherret/rust-toolchain-file@v1
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
       - name: Configure canary build
-        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
+        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
@@ -3226,7 +3226,6 @@ jobs:
           CFLAGS=$CFLAGS
           " > $GITHUB_ENV
       - name: Configure canary build
-        if: github.ref == 'refs/heads/main'
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         run: |-
@@ -4790,7 +4789,7 @@ jobs:
           CFLAGS=$CFLAGS
           " > $GITHUB_ENV
       - name: Configure canary build
-        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
+        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
         run: echo "DENO_CANARY=true" >> $GITHUB_ENV
       - name: Build release
         if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'