sanitize filename to prevent xss #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache emsdk | |
uses: actions/cache@v4 | |
with: | |
path: emsdk | |
key: ${{ runner.os }}-emsdk-${{ hashFiles('emsdk/emsdk_manifest.json') }} | |
restore-keys: | | |
${{ runner.os }}-emsdk- | |
- name: Setup Emscripten | |
run: | | |
if [ ! -d "emsdk" ]; then | |
git clone https://github.com/emscripten-core/emsdk.git | |
fi | |
cd emsdk | |
./emsdk install latest | |
./emsdk activate latest | |
source ./emsdk_env.sh | |
shell: bash | |
- name: Build the project | |
env: | |
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
run: | | |
echo "Building project for commit: $COMMIT_MESSAGE" | |
source ./emsdk/emsdk_env.sh | |
make release | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
publish_branch: gh-pages | |
codeql-analysis: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
matrix: | |
language: [ 'cpp', 'javascript' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache emsdk | |
uses: actions/cache@v4 | |
with: | |
path: emsdk | |
key: ${{ runner.os }}-emsdk-${{ hashFiles('emsdk/emsdk_manifest.json') }} | |
restore-keys: | | |
${{ runner.os }}-emsdk- | |
- name: Setup Emscripten environment | |
run: | | |
source ./emsdk/emsdk_env.sh | |
shell: bash | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
exclude: | | |
emsdk/ | |
- name: Build project manually | |
env: | |
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
run: | | |
echo "Running CodeQL analysis for commit: $COMMIT_MESSAGE" | |
source ./emsdk/emsdk_env.sh | |
make | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 |