Skip to content

Commit

Permalink
Fix zizmor security issues in GA (dftd4#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede authored Dec 15, 2024
1 parent 5bc636c commit 05e6eb0
Show file tree
Hide file tree
Showing 4 changed files with 464 additions and 392 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: "6 8 * * 2"

Expand All @@ -20,11 +20,13 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ python ]
language: [python]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
66 changes: 45 additions & 21 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,48 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- id: deploy-on-push
run:
echo "::set-output name=result::${{ env.DEPLOY_BRANCH }}"
env:
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH && contains(github.ref, secrets.DEPLOY_BRANCH) && 1 || 0 }}
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: pip install ford
- name: Build Documentation
run: ford ford.md
- uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' && steps.deploy-on-push.outputs.result != 0 }}
with:
branch: gh-pages
folder: _docs
single-commit: true
git-config-email: [email protected]
git-config-name: DFT-D4
- id: deploy-on-push
run: echo "result=$DEPLOY_BRANCH" >> $GITHUB_OUTPUT
env:
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH && contains(github.ref, secrets.DEPLOY_BRANCH) && '1' || '0' }}

- name: Set DEPLOY_BRANCH
id: set-deploy-branch
run: echo "DEPLOY_BRANCH=$DEPLOY_BRANCH" >> $GITHUB_ENV
env:
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH && contains(github.ref, secrets.DEPLOY_BRANCH) && '1' || '0' }}

- name: Validate DEPLOY_BRANCH
run: |
if [[ "$DEPLOY_BRANCH" != "1" && "$DEPLOY_BRANCH" != "0" ]]; then
echo "Invalid DEPLOY_BRANCH value: $DEPLOY_BRANCH"
exit 1
fi
env:
DEPLOY_BRANCH: ${{ env.DEPLOY_BRANCH }}

- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: pip install ford

- name: Build Documentation
run: ford ford.md

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' && steps.deploy-on-push.outputs.result != '0' }}
with:
branch: gh-pages
folder: _docs
single-commit: true
git-config-email: [email protected]
git-config-name: DFT-D4
Loading

0 comments on commit 05e6eb0

Please sign in to comment.