Skip to content

Commit

Permalink
Merge pull request #5 from wadakatu/feature/actions/shellcheck
Browse files Browse the repository at this point in the history
add shellcheck github actions workflow
  • Loading branch information
wadakatu authored Jan 11, 2025
2 parents a202330 + a7b8d6a commit c28ecf4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/shell_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: shell_check
on:
pull_request:
paths:
- '.github/workflows/shell_check.yml'
- '**.sh'

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
shell_check:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
path: "."
pattern: "*.sh"
fail_level: "warning"
check_all_files_with_shebangs: true
7 changes: 5 additions & 2 deletions symlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ process_directory() {
mkdir -p "$default_dest_dir"

find "$src_dir" -mindepth 1 -maxdepth 1 -type f | while read -r file; do
local filename=$(basename "$file")
local dest=$(get_special_dest "$filename")
local filename
local dest

filename=$(basename "$file")
dest=$(get_special_dest "$filename")

# 特別なリンク先がなければデフォルトのディレクトリを使用
[ -z "$dest" ] && dest="$default_dest_dir/$filename"
Expand Down

0 comments on commit c28ecf4

Please sign in to comment.