-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
76 lines (69 loc) · 2.29 KB
/
action.yml
File metadata and controls
76 lines (69 loc) · 2.29 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
68
69
70
71
72
73
74
75
76
name: "envcheck"
description: "Fast, modern Rust CLI for linting .env files and DevSecOps integrations"
author: "envcheck"
inputs:
command:
description: "The envcheck command to run (lint, compare, k8s-sync, terraform, ansible, actions, helm, argo, fix, doctor)"
required: false
default: "lint"
args:
description: "Additional arguments to pass to the command"
required: false
default: ""
version:
description: "Version of envcheck to install"
required: false
default: "latest"
env_file:
description: "Path to .env file (for DevSecOps commands)"
required: false
default: ".env"
runs:
using: "composite"
steps:
- name: Install envcheck
shell: bash
run: |
set -e
VERSION="${{ inputs.version }}"
# Try to download pre-built binary first (faster)
if [ "$VERSION" = "latest" ]; then
DOWNLOAD_URL="https://github.com/envcheck/envcheck/releases/latest/download/envcheck-x86_64-unknown-linux-gnu.tar.gz"
else
DOWNLOAD_URL="https://github.com/envcheck/envcheck/releases/download/v${VERSION}/envcheck-x86_64-unknown-linux-gnu.tar.gz"
fi
echo "Attempting to download envcheck from $DOWNLOAD_URL..."
if curl -sSfL "$DOWNLOAD_URL" -o /tmp/envcheck.tar.gz 2>/dev/null; then
tar -xzf /tmp/envcheck.tar.gz -C /tmp
sudo mv /tmp/envcheck /usr/local/bin/envcheck
chmod +x /usr/local/bin/envcheck
echo "envcheck installed from pre-built binary"
else
echo "Pre-built binary not available, falling back to cargo install..."
cargo install envcheck
fi
envcheck --version
- name: Run envcheck
shell: bash
run: |
COMMAND="${{ inputs.command }}"
ARGS="${{ inputs.args }}"
ENV_FILE="${{ inputs.env_file }}"
case "$COMMAND" in
lint|fix|compare|doctor)
envcheck $COMMAND $ARGS
;;
k8s-sync)
envcheck k8s-sync $ARGS --env "$ENV_FILE"
;;
terraform|ansible|actions|helm|argo)
envcheck $COMMAND . --env "$ENV_FILE" $ARGS
;;
*)
echo "Unknown command: $COMMAND"
exit 1
;;
esac
branding:
icon: "check-circle"
color: "green"