Skip to content

Commit

Permalink
Merge branch 'develop' into number/float32/base/signbit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Nov 15, 2024
2 parents a3e9d9c + 009becd commit ba25e1c
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/lint_copyright_years.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#/

# Workflow name:
name: 'Lint Copyright Years in Newly Added Files'
name: 'lint_copyright_years'

# Workflow triggers:
on:
Expand Down Expand Up @@ -85,30 +85,34 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
if [[ -z "$files" ]]; then
echo "No newly added files to check." >> $GITHUB_STEP_SUMMARY
exit 0
echo "No newly added files to check."
echo "No newly added files to check." >> $GITHUB_STEP_SUMMARY
exit 0
fi
for file in $files; do
if [[ ! -f "$file" ]]; then
continue
fi
if [[ ! -f "$file" ]]; then
continue
fi
# Check if file contains stdlib copyright notice:
year=$(grep -oP \
'Copyright \(c\) \K[0-9]{4}(?= The Stdlib Authors\.)' \
"$file")
# Check if file contains stdlib copyright notice:
year=$(grep -oP \
'Copyright \(c\) \K[0-9]{4}(?= The Stdlib Authors\.)' \
"$file")
if [[ -n "$year" ]]; then
if [[ "$year" == "$current_year" ]]; then
echo "- ✅ \`$file\`: Year is correct (**$year**)" >> $GITHUB_STEP_SUMMARY
else
echo "- ❌ **Error**: \`$file\` — Expected year **$current_year**, found **$year**" >> $GITHUB_STEP_SUMMARY
exit_code=1
fi
if [[ -n "$year" ]]; then
if [[ "$year" == "$current_year" ]]; then
echo "✅ $file: Correct year $year"
echo "- ✅ \`$file\`: Year is correct (**$year**)" >> $GITHUB_STEP_SUMMARY
else
echo "- ⚠️ No copyright notice found in \`$file\`" >> $GITHUB_STEP_SUMMARY
echo "❌ $file: Expected $current_year, found $year"
echo "- ❌ **Error**: \`$file\` — Expected year **$current_year**, found **$year**" >> $GITHUB_STEP_SUMMARY
exit_code=1
fi
else
echo "⚠️ $file: No copyright notice found"
echo "- ⚠️ No copyright notice found in \`$file\`" >> $GITHUB_STEP_SUMMARY
fi
done
exit $exit_code

0 comments on commit ba25e1c

Please sign in to comment.