Skip to content

ci: remediate zizmor findings (#19283) #18670

ci: remediate zizmor findings (#19283)

ci: remediate zizmor findings (#19283) #18670

Workflow file for this run

name: CodeQL
on:
pull_request:
branches:
- main
- release/*
- cloudfoundry
- gh-pages
push:
branches:
- main
- release/*
- cloudfoundry
- gh-pages
schedule:
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
permissions:
contents: read
actions: read # for github/codeql-action/init to get workflow details
security-events: write # for github/codeql-action/analyze to upload SARIF results
strategy:
fail-fast: false
matrix:
include:
- language: actions
- language: java
runs-on: ${{ github.repository == 'open-telemetry/opentelemetry-java-instrumentation' && 'oracle-vm-8cpu-32gb-x86-64' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# don't need to free disk space (which takes time) since running on larger machine
- name: Set up JDK 11
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: 11
- name: Set up JDK for running Gradle
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version-file: .java-version
- name: Increase gradle daemon heap size
run: |
# increasing more than other workflows since this is running on a large runner
# and so it uses more parallelism which uses more memory
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx8g /" gradle.properties
- name: Set up Gradle
# zizmor: ignore[cache-poisoning] This workflow analyzes release branches
# but does not build or publish release artifacts.
if: matrix.language == 'java'
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}
- name: Initialize CodeQL
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: ${{ matrix.language }}
# using "linked" helps to keep up with the linked Kotlin support
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
tools: linked
- name: Assemble
if: matrix.language == 'java'
# --no-build-cache is required for codeql to analyze all modules
# --no-daemon is required for codeql to observe the compilation
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands)
run: >
./gradlew assemble -x javadoc
--no-build-cache --no-daemon
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:${{matrix.language}}"
workflow-notification:
permissions:
issues: write
needs:
- analyze
if: always() && github.event_name == 'schedule'
uses: open-telemetry/shared-workflows/.github/workflows/workflow-failure-issue.yml@62d5939b47144252763c5ff9fffe8c20d76cd806 # v0.4.0
with:
success: ${{ needs.analyze.result == 'success' }}