Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: "Specify Node.js version (e.g., '18', '20', 'lts/*')"
required: false
default: "24"
mode:
description: "Run mode: cherry-pick or verify"
required: false
default: "cherry-pick"
pull_request:
types: [opened, synchronize, labeled]

Expand All @@ -22,11 +26,11 @@ permissions:

jobs:
cherry-pick:
if: github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@fix_Verify_cherry_pick-Logic
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead condition — workflow_run trigger is missing.

The if: clause includes github.event_name == 'workflow_run' but the workflow's on: block only declares workflow_dispatch and pull_request triggers. A workflow_run event can never reach this workflow, so this branch of the condition is unreachable dead code.

Either add a workflow_run: trigger to on: (if the intent is to fire after another workflow completes), or remove the workflow_run clause:

Suggested change
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
if: github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')

uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
with:
original-owner: "Swatinem"
repo-name: "rust-cache"
base_branch: ${{ inputs.base_branch }}
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode }}
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode || 'cherry-pick' }}
node_version: "${{ inputs.node_version || '24' }}"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: buildjet
name: warpbuild

on:
on:
push:
branches: ["main"]
pull_request:
Expand All @@ -9,13 +9,13 @@ on:
permissions: {}

jobs:
buildjet:
warpbuild:
strategy:
fail-fast: false
matrix:
os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]') }}

name: Test buildjet provider on ${{ matrix.os }}
name: Test warpbuild provider on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

env:
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: ./
with:
workspaces: tests
cache-provider: buildjet
cache-provider: warpbuild

- run: |
cargo check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ target/

# Mac
.DS_Store
.build
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
min-release-age=3
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sensible defaults.
## Example usage

```yaml
- uses: actions/checkout@v5
- uses: actions/checkout@v7

# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
Expand All @@ -34,7 +34,7 @@ sensible defaults.
# default: "true"
add-job-id-key: ""

# Weather the a hash of the rust environment should be included in the cache key.
# Whether the a hash of the rust environment should be included in the cache key.
# This includes a hash of all Cargo.toml/Cargo.lock files, rust-toolchain files,
# and .cargo/config.toml files (if present), as well as the specified 'env-vars'.
# default: "true"
Expand Down Expand Up @@ -94,7 +94,7 @@ sensible defaults.
lookup-only: ""

# Specifies what to use as the backend providing cache
# Can be set to "github", "buildjet", or "warpbuild"
# Can be set to "github", or "warpbuild"
# default: "github"
cache-provider: ""

Expand Down Expand Up @@ -144,7 +144,7 @@ This action currently caches the following files/directories:
This cache is automatically keyed by:

- the github [`job_id`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id)
(if `add-job-id-key` is `"true"`),
(if `add-job-id-key` is `"true"`),
- the rustc release / host / hash (for all installed toolchains when
available),
- the following values, if `add-rust-environment-hash-key` is `"true"`:
Expand Down Expand Up @@ -212,5 +212,5 @@ to see those details as well as further details related to caching operations.
- The cache cleaning process currently removes all the files from `~/.cargo/bin`
that were present before the action ran (for example `rustc`), by default.
This can be an issue on long-running self-hosted runners, where such state
is expected to be preserved across runs. You can work around this by setting
is expected to be preserved across runs. You can work around this by setting
`cache-bin: "false"`.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ inputs:
required: false
default: "true"
cache-provider:
description: "Determines which provider to use for caching. Options are github, buildjet, or warpbuild. Defaults to github."
description: "Determines which provider to use for caching. Options are github, or warpbuild. Defaults to github."
required: false
default: "github"
cache-bin:
Expand All @@ -68,8 +68,8 @@ outputs:
description: "A boolean value that indicates an exact match was found."
runs:
using: "node24"
main: "dist/restore/index.js"
post: "dist/save/index.js"
main: "dist/restore.js"
post: "dist/save.js"
post-if: "success() || env.CACHE_ON_FAILURE == 'true'"
branding:
icon: "archive"
Expand Down
Loading
Loading