Skip to content

Commit

Permalink
Fixed bug in Github action
Browse files Browse the repository at this point in the history
Signed-off-by: HAHWUL <hahwul@gmail.com>
  • Loading branch information
hahwul committed Oct 6, 2024
1 parent 2e9845b commit 0c651c4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ deadfinder sitemap https://www.hahwul.com/sitemap.xml
```yml
steps:
- name: Run DeadFinder
uses: hahwul/deadfinder@1.4.1
uses: hahwul/deadfinder@1.4.2
# or uses: hahwul/deadfinder@latest
id: broken-link
with:
Expand Down
2 changes: 1 addition & 1 deletion github-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/hahwul/deadfinder:1.4.1
FROM ghcr.io/hahwul/deadfinder:1.4.2
COPY entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
17 changes: 13 additions & 4 deletions github-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ cmd="$df $1 $2 -o /output.json"

# Add headers if provided
if [ -n "$6" ]; then
IFS=',' read -r -a headers_array <<< "$6"
for header in "${headers_array[@]}"; do
cmd="$cmd -H \"$header\""
IFS=',' headers="$6"
for header in $headers; do
if [ -n "$header" ]; then
cmd="$cmd -H \"$header\""
fi
done
fi

# Execute the command
eval $cmd
eval "$cmd"
echo "Command executed: $cmd"

# Check if the output file exists
if [ ! -f /output.json ]; then
echo "Error: /output.json not found"
exit 1
fi

# Read the output and set it as a GitHub Action output
out=$(cat /output.json)
Expand Down
2 changes: 1 addition & 1 deletion lib/deadfinder/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

VERSION = '1.4.1'
VERSION = '1.4.2'

0 comments on commit 0c651c4

Please sign in to comment.