
Pin the Github Action dependencies to the hash according to secure software development best practices recommended by the Open Source Security Foundation (OpenSSF). When developing a CI workflow, it's common to version-pin dependencies (i.e. actions/checkout@v4). However, version tags are mutable, so a malicious attacker could overwrite a version tag to point to a malicious or vulnerable commit instead. Pinning workflow dependencies by hash ensures the dependency is immutable and its behavior is guaranteed. See https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies The `dependabot` supports updating a hash and the version comment so its update will continue to work as before. Links to used actions and theit tag/hash for review/validation: https://github.com/actions/checkout/tags (v4.1.2 was rolled back) https://github.com/github/codeql-action/tags https://github.com/maxim-lobanov/setup-xcode/tags https://github.com/cross-platform-actions/action/releases/tag/v0.22.0 https://github.com/py-actions/py-dependency-install/tags https://github.com/actions/upload-artifact/tags https://github.com/actions/setup-node/tags https://github.com/taiki-e/install-action/releases/tag/v2.32.2 This PR is part of #211. Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
# Creates and uploads a Coverity build on a schedule
|
|
name: Coverity Scan
|
|
on:
|
|
schedule:
|
|
# Run once daily, since below 500k LOC can have 21 builds per week, per https://scan.coverity.com/faq#frequency
|
|
- cron: '0 0 * * *'
|
|
# Support manual execution
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
coverity:
|
|
if: github.repository == 'valkey-io/valkey'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Download and extract the Coverity Build Tool
|
|
run: |
|
|
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=valkey-io%2Fvalkey" -O cov-analysis-linux64.tar.gz
|
|
mkdir cov-analysis-linux64
|
|
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
|
|
- name: Install Valkey dependencies
|
|
run: sudo apt install -y gcc procps libssl-dev
|
|
- name: Build with cov-build
|
|
run: cov-analysis-linux64/bin/cov-build --dir cov-int make
|
|
- name: Upload the result
|
|
run: |
|
|
tar czvf cov-int.tgz cov-int
|
|
curl \
|
|
--form email=${{ secrets.COVERITY_SCAN_EMAIL }} \
|
|
--form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
|
|
--form file=@cov-int.tgz \
|
|
https://scan.coverity.com/builds?project=valkey-io%2Fvalkey
|