Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/destructive-command-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
Loading