Skip to content

Commit

Permalink
Update daily-commit-link.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunterdii authored Nov 6, 2024
1 parent 92e6487 commit 0c0d253
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/daily-commit-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
# Fetch the latest commit from the repository
COMMIT_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits?sha=main&per_page=1")
# Debugging: output the full commit data
echo "Commit Data: $COMMIT_DATA"
# Check if the commit data was retrieved successfully
if [ -z "$COMMIT_DATA" ]; then
echo "Error: No commit data received" >&2
Expand All @@ -42,6 +45,9 @@ jobs:
# Extract the filename of the solution from the commit message
FILE_NAME=$(echo $COMMIT_DATA | jq -r '.[0].commit.message' | grep -oP '\d{2}\(.*\).md')
# Debugging: output the extracted filename
echo "Extracted Filename: $FILE_NAME"
# Check if a valid filename was extracted
if [ -z "$FILE_NAME" ]; then
echo "Error: No filename found in commit message" >&2
Expand Down

0 comments on commit 0c0d253

Please sign in to comment.