Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 522a357b02 | |||
| 286a543147 | |||
| 3bbcb0cbaa | |||
| 0de646aedf | |||
| 72ae029eb2 | |||
| 781f3244d3 | |||
| 37936e924d | |||
| 34ae98ab6a | |||
| 42612788d3 | |||
| e1a364274d |
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[build]
|
||||||
|
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
|
||||||
40
.ci.yml
Normal file
40
.ci.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Rust
|
||||||
|
run: |
|
||||||
|
rustup default stable
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --release
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy -- -D warnings
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build Release
|
||||||
|
run: |
|
||||||
|
cargo build --release --locked
|
||||||
|
- name: Create Release
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
target/release/env-guard
|
||||||
|
title: ${{ github.ref_name }}
|
||||||
|
body: "Release ${{ github.ref_name }}"
|
||||||
19
.envguard.toml
Normal file
19
.envguard.toml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[tool.envguard]
|
||||||
|
name = "env-guard"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "A comprehensive .env file guardian tool for validation, scanning, and secrets detection"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
clap = { version = "4.4", features = ["derive"] }
|
||||||
|
anyhow = "1.0"
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
serde_json = "1.0"
|
||||||
|
regex = "1.10"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["std"]
|
||||||
|
std = []
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
opt-level = 3
|
||||||
@@ -2,65 +2,39 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, master]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, master]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Rust
|
||||||
- name: Install Rust
|
run: |
|
||||||
uses: actions/setup-rust@v1
|
rustup default stable
|
||||||
with:
|
rustc --version
|
||||||
toolchain: stable
|
cargo --version
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --all
|
run: cargo test
|
||||||
|
- name: Clippy
|
||||||
- name: Run clippy
|
run: cargo clippy -- -D warnings
|
||||||
run: cargo clippy --all --all-features -- -D warnings
|
|
||||||
|
|
||||||
- name: Check formatting
|
|
||||||
run: cargo fmt -- --check
|
|
||||||
|
|
||||||
binary:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: test
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: actions/setup-rust@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: x86_64-unknown-linux-musl
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Build binary
|
|
||||||
run: cargo build --release --target x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
- name: Upload binary artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: env-guard-linux-amd64
|
|
||||||
path: target/x86_64-unknown-linux-musl/release/env-guard
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: binary
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build Release
|
||||||
|
run: |
|
||||||
|
cargo build --release --locked
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: https://gitea.com/actions/release-action@main
|
uses: https://gitea.com/actions/release-action@main
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
target/x86_64-unknown-linux-musl/release/env-guard
|
target/release/env-guard
|
||||||
title: ${{ github.ref_name }}
|
title: ${{ github.ref_name }}
|
||||||
body: "Release ${{ github.ref_name }} of env-guard"
|
body: "Release ${{ github.ref_name }}"
|
||||||
|
|||||||
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Rust
|
||||||
|
run: |
|
||||||
|
rustup default stable
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --release
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy -- -D warnings
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build Release
|
||||||
|
run: |
|
||||||
|
cargo build --release --locked
|
||||||
|
- name: Create Release
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
target/release/env-guard
|
||||||
|
title: ${{ github.ref_name }}
|
||||||
|
body: "Release ${{ github.ref_name }}"
|
||||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,19 +1,22 @@
|
|||||||
|
# Cargo
|
||||||
target/
|
target/
|
||||||
|
*.lock
|
||||||
|
|
||||||
|
# Environment
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
.env
|
# Secrets
|
||||||
.env.local
|
|
||||||
.env.*.local
|
|
||||||
*.pem
|
*.pem
|
||||||
|
*.key
|
||||||
test_*.txt
|
|
||||||
test_*.env
|
|
||||||
|
|
||||||
*.log
|
|
||||||
|
|||||||
Reference in New Issue
Block a user