-
Notifications
You must be signed in to change notification settings - Fork 19
35 lines (30 loc) · 1022 Bytes
/
destructive-command-guard.yml
File metadata and controls
35 lines (30 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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