Use direct Destructive Command Guard binary install #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Destructive Command Guard | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| scan: | |
| name: Scan destructive commands | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Destructive Command Guard | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| version="v0.4.5" | |
| platform="x86_64-unknown-linux-gnu" | |
| install_dir="$RUNNER_TEMP/dcg" | |
| mkdir -p "$install_dir" | |
| curl --fail --location --silent --show-error \ | |
| "https://github.com/Dicklesworthstone/destructive_command_guard/releases/download/${version}/dcg-${platform}.tar.xz" \ | |
| --output "$install_dir/dcg.tar.xz" | |
| tar -xJf "$install_dir/dcg.tar.xz" -C "$install_dir" | |
| chmod +x "$install_dir/dcg" | |
| echo "$install_dir" >> "$GITHUB_PATH" | |
| - name: Run Destructive Command Guard | |
| shell: bash | |
| run: dcg scan --paths . --fail-on error --format pretty |