Skip to content

Commit

Permalink
apply GHA security improvements suggested by zizmor
Browse files Browse the repository at this point in the history
  • Loading branch information
dfremont committed Dec 14, 2024
1 parent a6e48a2 commit cf6d774
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Run black to check formatting
uses: psf/black@stable
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-call-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ jobs:
if: inputs.ref != ''
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- name: Checkout current branch
uses: actions/checkout@v3
if: inputs.ref == ''
with:
ref: ${{ github.ref }}
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-simulators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ jobs:
HOSTNAME: ${{ secrets.SSH_HOST }}
USER_NAME: ${{ secrets.SSH_USERNAME }}
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
GH_REF: ${{ github.ref }}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} '
cd /home/ubuntu/actions/ &&
rm -rf Scenic &&
git clone --branch $(basename "${{ github.ref }}") --single-branch https://[email protected]/BerkeleyLearnVerify/Scenic.git &&
git clone --branch $(basename "${GH_REF}") --single-branch https://[email protected]/BerkeleyLearnVerify/Scenic.git &&
cd Scenic &&
python3 -m venv venv &&
source venv/bin/activate &&
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ jobs:
if: inputs.ref != ''
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- name: Checkout current branch
uses: actions/checkout@v3
if: inputs.ref == ''
with:
ref: ${{ github.ref }}
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -69,5 +71,8 @@ jobs:
python -m pip install -e ".[test-full]"
- name: Run pytest
env:
TEST_OPTIONS: ${{ inputs.options || (matrix.slow && '--no-graphics' || '--fast --no-graphics') }}
shell: sh
run: |
pytest ${{ inputs.options || (matrix.slow && '--no-graphics' || '--fast --no-graphics') }}
pytest ${TEST_OPTIONS}

0 comments on commit cf6d774

Please sign in to comment.