From baff4029c7f860759cb032c75d4a3dc21d566fdb Mon Sep 17 00:00:00 2001 From: grloper <72247422+grloper@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:02:28 +0300 Subject: [PATCH] ci: add CodeQL (rust, actions) and OSSF Scorecard workflows --- .github/workflows/codeql.yml | 36 +++++++++++++++++++++++++++++++ .github/workflows/scorecard.yml | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..9bd4711 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,36 @@ +name: codeql + +on: + pull_request: + push: + branches: [main] + schedule: + - cron: "41 5 * * 2" + workflow_dispatch: + +permissions: + contents: read + +jobs: + analyze: + name: analyze (${{ matrix.language }}) + runs-on: ubuntu-22.04 + timeout-minutes: 30 + permissions: + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [rust, actions] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 + with: + languages: ${{ matrix.language }} + build-mode: none + - uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..ed026f5 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,38 @@ +name: scorecard + +on: + branch_protection_rule: + push: + branches: [main] + schedule: + - cron: "23 6 * * 3" + workflow_dispatch: + +permissions: read-all + +jobs: + analysis: + runs-on: ubuntu-22.04 + timeout-minutes: 15 + permissions: + security-events: write # upload SARIF + id-token: write # publish results to the OpenSSF API (public repo) + contents: read + actions: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 + with: + name: scorecard-sarif + path: results.sarif + retention-days: 5 + - uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 + with: + sarif_file: results.sarif