Fix failing builds

This commit is contained in:
Jesse Wierzbinski 2023-11-28 11:39:30 -10:00
parent 700681314d
commit 6c57efae31
No known key found for this signature in database
3 changed files with 168 additions and 171 deletions

View file

@ -12,71 +12,70 @@
name: "CodeQL" name: "CodeQL"
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ "main" ] branches: ["main"]
schedule: schedule:
- cron: '18 19 * * 4' - cron: "18 19 * * 4"
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see: # Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql # - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners # - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements. # Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions: permissions:
actions: read actions: read
contents: read contents: read
security-events: write security-events: write
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
language: [ 'javascript-typescript' ] language: ["javascript-typescript"]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v2
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file. # By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file. # Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality # queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # Command-line programs to run using the OS shell.
# If this step fails, then you should remove it and run the build manually (see below) # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell. # If the Autobuild fails above, remove it and uncomment the following three lines.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines. # - run: |
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: | - name: Perform CodeQL Analysis
# echo "Run, Build Application using script" uses: github/codeql-action/analyze@v2
# ./location_of_script_within_repo/buildscript.sh with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

View file

@ -6,93 +6,91 @@ name: Build and publish Docker image
# documentation. # documentation.
on: on:
schedule: schedule:
- cron: '22 5 * * *' - cron: "22 5 * * *"
push: push:
branches: [ "main" ] branches: ["main"]
# Publish semver tags as releases. # Publish semver tags as releases.
tags: [ 'v*.*.*' ] tags: ["v*.*.*"]
pull_request: pull_request:
branches: [ "main" ] branches: ["main"]
env: env:
# Use docker.io for Docker Hub if empty # Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io REGISTRY: ghcr.io
# github.repository as <account>/<repo> # github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
build: build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
runs-on: ubuntu-latest steps:
permissions: - name: Checkout repository
contents: read uses: actions/checkout@v3
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps: # Install the cosign tool except on PR
- name: Checkout repository # https://github.com/sigstore/cosign-installer
uses: actions/checkout@v3 - name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: "v2.1.1"
# Install the cosign tool except on PR # Set up BuildKit Docker container builder to be able to build
# https://github.com/sigstore/cosign-installer # multi-platform images and export cache
- name: Install cosign # https://github.com/docker/setup-buildx-action
if: github.event_name != 'pull_request' - name: Set up Docker Buildx
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
with:
cosign-release: 'v2.1.1'
# Set up BuildKit Docker container builder to be able to build # Login against a Docker registry except on PR
# multi-platform images and export cache # https://github.com/docker/login-action
# https://github.com/docker/setup-buildx-action - name: Log into registry ${{ env.REGISTRY }}
- name: Set up Docker Buildx if: github.event_name != 'pull_request'
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against a Docker registry except on PR # Extract metadata (tags, labels) for Docker
# https://github.com/docker/login-action # https://github.com/docker/metadata-action
- name: Log into registry ${{ env.REGISTRY }} - name: Extract Docker metadata
if: github.event_name != 'pull_request' id: meta
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with: with:
registry: ${{ env.REGISTRY }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker # Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/metadata-action # https://github.com/docker/build-push-action
- name: Extract Docker metadata - name: Build and push Docker image
id: meta id: build-and-push
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Build and push Docker image with Buildx (don't push on PR) # Sign the resulting Docker image digest except on PRs.
# https://github.com/docker/build-push-action # This will only write to the public Rekor transparency log when the Docker
- name: Build and push Docker image # repository is public to avoid leaking data. If you would like to publish
id: build-and-push # transparency data even for private images, pass --force to cosign below.
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 # https://github.com/sigstore/cosign
with: - name: Sign the published Docker image
context: . if: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }} env:
tags: ${{ steps.meta.outputs.tags }} # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
labels: ${{ steps.meta.outputs.labels }} TAGS: ${{ steps.meta.outputs.tags }}
cache-from: type=gha DIGEST: ${{ steps.build-and-push.outputs.digest }}
cache-to: type=gha,mode=max # This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
# Sign the resulting Docker image digest except on PRs. run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

View file

@ -10,43 +10,43 @@
name: ESLint Checks name: ESLint Checks
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ "main" ] branches: ["main"]
schedule: schedule:
- cron: '35 17 * * 3' - cron: "35 17 * * 3"
jobs: jobs:
eslint: eslint:
name: Run eslint scanning name: Run eslint scanning
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
security-events: write security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Bun - name: Setup Bun
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v1
- name: Install NPM packages - name: Install NPM packages
run: | run: |
bun install bun install
- name: Generate Prisma Client
run: |
bun prisma generate
- name: Run ESLint - name: Generate Prisma Client
run: | run: |
bunx eslint . --config .eslintrc.cjs --ext .js,.jsx,.ts,.tsx --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif bunx prisma generate
continue-on-error: true
- name: Upload analysis results to GitHub - name: Run ESLint
uses: github/codeql-action/upload-sarif@v2 run: |
with: bunx eslint . --config .eslintrc.cjs --ext .js,.jsx,.ts,.tsx --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif
sarif_file: eslint-results.sarif continue-on-error: true
wait-for-processing: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true