Skip to content

ci: modernize Semgrep and Slither actions to resolve workflow failure #2102

ci: modernize Semgrep and Slither actions to resolve workflow failure

ci: modernize Semgrep and Slither actions to resolve workflow failure #2102

Workflow file for this run

# Name of this GitHub Actions workflow.
name: Run Semgrep
on:
# Scan changed files in PRs (diff-aware scanning):
pull_request: {}
# On-demand
workflow_dispatch: {}
jobs:
semgrep:
# User-definable name of this GitHub Actions job:
name: Scan
# If you are self-hosting, change the following `runs-on` value:
runs-on: ubuntu-latest
env:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
ETHERSCAN_KEY_FOR_OPTIMISM: ${{ secrets.ETHERSCAN_KEY_FOR_OPTIMISM }}
ETHERSCAN_KEY_FOR_BASE: ${{ secrets.ETHERSCAN_KEY_FOR_BASE }}
ETHERSCAN_KEY_FOR_ARBITRUM: ${{ secrets.ETHERSCAN_KEY_FOR_ARBITRUM }}
ETHERSCAN_KEY_FOR_POLYGON: ${{ secrets.ETHERSCAN_KEY_FOR_POLYGON }}
ETHERSCAN_KEY_FOR_LINEA: ${{ secrets.ETHERSCAN_KEY_FOR_LINEA }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
MAINNET_QUICKNODE_LINK: ${{ secrets.MAINNET_QUICKNODE_LINK }}
RONIN_QUICKNODE_LINK: ${{ secrets.RONIN_QUICKNODE_LINK }}
POLYGON_QUICKNODE_LINK: ${{ secrets.POLYGON_QUICKNODE_LINK }}
OPTIMISM_QUICKNODE_LINK: ${{ secrets.OPTIMISM_QUICKNODE_LINK }}
MANTLE_QUICKNODE_LINK: ${{ secrets.MANTLE_QUICKNODE_LINK }}
BASE_QUICKNODE_LINK: ${{ secrets.BASE_QUICKNODE_LINK }}
ARBITRUM_QUICKNODE_LINK: ${{ secrets.ARBITRUM_QUICKNODE_LINK }}
_TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
UNICHAIN_QUICKNODE_LINK: ${{ secrets.UNICHAIN_QUICKNODE_LINK }}
LINEA_QUICKNODE_LINK: ${{ secrets.LINEA_QUICKNODE_LINK }}
container:
# A Docker image with Semgrep installed. Do not change this.
image: returntocorp/semgrep
# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')
steps:
# Fetch project source with GitHub Actions Checkout.
- uses: actions/checkout@v4
# Fetch generic rules
- name: Fetch generic semgrep rules
uses: actions/checkout@v4
with:
repository: decurity/semgrep-smart-contracts
path: rules
# Fetch Compound rules
- name: Fetch Compound semgrep rules
uses: actions/checkout@v4
with:
repository: decurity/compound-semgrep-rules
path: compound
# Run security, performance & Compound specific rules
- run: semgrep ci --sarif --output=semgrep.sarif || true
env:
SEMGREP_RULES: rules/solidity/security rules/solidity/performance compound/solidity
# Upload findings to GitHub Advanced Security Dashboard
- name: Upload findings to GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep.sarif
if: always()