From 16d2ac375376d6bfca0920e170c5014a451fb1c6 Mon Sep 17 00:00:00 2001 From: Prabesh Thapa Date: Wed, 1 May 2024 20:38:24 -0700 Subject: [PATCH] shellcheck and add CI action --- .github/workflows/audit.yaml | 34 ++++++++++++++++++++++++++++++++++ bootstrap.sh | 18 +++++++++--------- 2 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/audit.yaml diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml new file mode 100644 index 0000000..c367eec --- /dev/null +++ b/.github/workflows/audit.yaml @@ -0,0 +1,34 @@ +name: Linting and auditing + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + + detect-secrets: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + + - name: trufflehog-actions-scan + uses: edplato/trufflehog-actions-scan@master + with: + scanArguments: '--regex --entropy=False --max_depth=5 --rules /regexes.json' # Add custom options here* + + - name: detect secrets + uses: edplato/trufflehog-actions-scan@v0.9l-beta diff --git a/bootstrap.sh b/bootstrap.sh index 6a015ad..0ac0c74 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Set up the configuration directory -export CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} +export CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME"/.config} if [[ ! -d "$CONFIG_HOME" ]]; then mkdir -p "$CONFIG_HOME" fi @@ -121,14 +121,14 @@ function setup_dotfiles { if [ ! -d "$HOME/.oh-my-zsh" ]; then KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" fi - ln -sf $DOTFILES/zsh/zshrc $HOME/.zshrc + ln -sf "$DOTFILES"/zsh/zshrc "$HOME"/.zshrc # Yabai - ln -sf $DOTFILES/yabai/yabairc $HOME/.yabairc + ln -sf "$DOTFILES"/yabai/yabairc "$HOME"/.yabairc chmod +x ~/.yabairc # skhd - ln -sf $DOTFILES/skhd/skhdrc $HOME/.skhdrc + ln -sf "$DOTFILES"/skhd/skhdrc "$HOME"/.skhdrc chmod +x ~/.skhdrc } @@ -141,15 +141,15 @@ function setup_directories { # Function to set up configuration files function setup_config_files { # Neovim - rm -rf $HOME/.config/nvim - ln -s $DOTFILES/nvim $HOME/.config/nvim + rm -rf "$HOME"/.config/nvim + ln -s "$DOTFILES"/nvim "$HOME"/.config/nvim # Kitty - rm -rf $HOME/.config/kitty - ln -s $DOTFILES/kitty $HOME/.config/kitty + rm -rf "$HOME"/.config/kitty + ln -s "$DOTFILES"/kitty "$HOME"/.config/kitty # Git - ln -sf $DOTFILES/git/gitconfig $HOME/.gitconfig + ln -sf "$DOTFILES"/git/gitconfig "$HOME"/.gitconfig } # Run the installation functions