Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all uses of actions/checkout to use explicit ref #3322

Merged
merged 2 commits into from
Sep 14, 2023
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/checkboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}
- uses: streetsidesoftware/cspell-action@v2
with:
config: "docs/cspell.json"
Expand All @@ -24,6 +26,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}
- uses: jprochazk/linkinator-action@main
with:
paths: "docs/**/*.md"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_and_test_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:

- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || github.sha }}
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || github.sha) }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_build_and_upload_rerun_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ jobs:
INPUTS_CONTEXT: ${{ toJson(inputs) }}

- uses: actions/checkout@v4
with:
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.ref) || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_build_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.ref) || github.sha }}

- name: Download Web Viewer
uses: actions/download-artifact@v3
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -85,6 +88,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -113,6 +118,8 @@ jobs:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down Expand Up @@ -196,6 +203,8 @@ jobs:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down Expand Up @@ -227,6 +236,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Install taplo-cli
uses: taiki-e/install-action@v2
Expand All @@ -244,6 +255,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -274,6 +287,8 @@ jobs:
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Check spelling of entire workspace
uses: crate-ci/typos@master
Expand All @@ -287,6 +302,8 @@ jobs:
image: rerunio/ci_docker:0.9
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Cargo Deny
shell: bash
Expand All @@ -300,6 +317,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Run clang format on all relevant files
uses: jidicula/clang-format-action@v4.11.0
Expand All @@ -317,6 +336,8 @@ jobs:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand All @@ -338,3 +359,4 @@ jobs:
- name: Build code examples
shell: bash
run: ./docs/code-examples/build_all.sh --werror

4 changes: 2 additions & 2 deletions .github/workflows/reusable_deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Don't do a shallow clone
ref: ${{ inputs.RELEASE_COMMIT || github.sha }}
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha) }}

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Don't do a shallow clone since we need to push gh-pages
ref: ${{ inputs.RELEASE_COMMIT || github.sha }}
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha) }}

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_pip_index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.COMMIT || github.sha }}
ref: ${{ inputs.COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha) }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_pr_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || github.sha }}
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha) }}

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_run_notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Download Wheel
uses: actions/download-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_track_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Get context
id: context
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_update_pr_body.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_upload_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Download RRD
uses: actions/download-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable_upload_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha }}

- name: Download web demo assets
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_upload_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || github.sha }}
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.sha) }}

- name: Download RRD
uses: actions/download-artifact@v3
Expand Down
Loading