Skip to content

Commit

Permalink
Add persist-credentials: false to actions/checkout uses, fix up mik…
Browse files Browse the repository at this point in the history
…e action

Based on zizmor's findings.

Fixing mike works by supplying the shell command-line inputs as envvars, since
they are always fully expanded by the shell, preventing surprise injections at
the template level.
  • Loading branch information
nicholasjng committed Jan 8, 2025
1 parent 6a69136 commit 36234b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/actions/mike-docs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ runs:
shell: bash
- env:
DOCS_PRERELEASE: ${{ inputs.pre_release }}
INPUTS_PUSH: ${{ inputs.push }}
INPUTS_VERSION: ${{ inputs.version }}
INPUTS_ALIAS: ${{ inputs.alias }}
run: |
MIKE_OPTIONS=( "--update-aliases" )
if [ "true" = "${{ inputs.push }}" ]; then
if [ "true" = "${INPUTS_PUSH}" ]; then
MIKE_OPTIONS+=( "--push" )
fi
uv run mike deploy ${{ inputs.version }} ${{ inputs.alias }} "${MIKE_OPTIONS[@]}"
uv run mike deploy "${INPUTS_VERSION}" ${INPUTS_ALIAS} "${MIKE_OPTIONS[@]}"
shell: bash
5 changes: 5 additions & 0 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
Expand All @@ -30,6 +32,8 @@ jobs:
python-version: [ "3.10", 3.11, 3.12, 3.13 ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
Expand All @@ -43,6 +47,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
Expand Down

0 comments on commit 36234b3

Please sign in to comment.