Skip to content

Commit

Permalink
Bypass context
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Mar 3, 2025
1 parent c9bb204 commit b9b4395
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---

inputs:
calling-job-context:
description: A JSON with the calling job inputs
type: string

runs:
using: composite
steps:
- name: Log setting up pre-commit cache
if: inputs.toxenv == 'pre-commit'
if: fromJSON(inputs.calling-job-context).toxenv == 'pre-commit'
run: >-
>&2 echo Caching ~/.cache/pre-commit based on
the contents of `.pre-commit-config.yaml`...
shell: bash
- name: Cache pre-commit.com virtualenvs
if: inputs.toxenv == 'pre-commit'
if: fromJSON(inputs.calling-job-context).toxenv == 'pre-commit'
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
Expand All @@ -20,13 +25,5 @@ runs:
}}-pre-commit-${{
hashFiles('.pre-commit-config.yaml')
}}
- name: Log contexts
run: |
echo github: ${{ toJSON(github) }}
echo inputs: ${{ toJSON(inputs) }}
echo job: ${{ toJSON(job) }}
echo matrix: ${{ toJSON(matrix) }}
echo runner: ${{ toJSON(runner) }}
shell: bash
...
3 changes: 2 additions & 1 deletion .github/workflows/reusable-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ jobs:
hashFiles(
'.github/stdlib-workflows/reusable-tox/actions/post-src-checkout/action.yml'
) != ''
with: ${{ inputs }}
with:
context: ${{ inputs }}

- name: Set up pip cache
uses: re-actors/cache-python-deps@release/v1
Expand Down

0 comments on commit b9b4395

Please sign in to comment.