-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
67 lines (58 loc) · 1.79 KB
/
action.yml
File metadata and controls
67 lines (58 loc) · 1.79 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "🐕 Bark! - Save yourself from production embarrassments"
description: "Check for BARK comments in your code before merging"
author: "debkanchan"
branding:
icon: "alert-circle"
color: "orange"
inputs:
path:
description: "Path to scan for BARK comments"
required: false
default: "."
format:
description: "Output format (text or json)"
required: false
default: "text"
fail-on-findings:
description: "Fail the build if BARK comments are found"
required: false
default: "true"
version:
description: "Version of bark to install (latest or specific version like v1.0.0)"
required: false
default: "latest"
runs:
using: "composite"
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.24.5"
- name: Install Bark
shell: bash
run: |
echo "🐕 Installing Bark..."
if [ "${{ inputs.version }}" = "latest" ]; then
go install github.com/debkanchan/bark/cmd/bark@latest
else
go install github.com/debkanchan/bark/cmd/bark@${{ inputs.version }}
fi
# Add Go bin to PATH
echo "$HOME/go/bin" >> $GITHUB_PATH
echo "✅ Bark installed successfully"
- name: Run Bark
shell: bash
run: |
echo "🔍 Scanning for BARK comments in ${{ inputs.path }}"
# Use full path as fallback
BARK_CMD="bark"
if ! command -v bark &> /dev/null; then
BARK_CMD="$HOME/go/bin/bark"
fi
$BARK_CMD -format ${{ inputs.format }} ${{ inputs.path }} || exit_code=$?
exit_code=${exit_code:-0}
if [ "${{ inputs.fail-on-findings }}" = "false" ]; then
echo "ℹ️ Bark scan completed (fail-on-findings: false)"
exit 0
fi
exit $exit_code