Skip to content

fix(deps): update junit5 monorepo to v5.11.2 #114

fix(deps): update junit5 monorepo to v5.11.2

fix(deps): update junit5 monorepo to v5.11.2 #114

Workflow file for this run

# The MIT License (MIT)
#
# Copyright (c) 2022-2024 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
name: copyright
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
copyright:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run check
shell: bash
run: |
# Get the current year
current_year=$(date +"%Y")
# Ignore files and directories
ignore_files=("*/.git/*" "*/.github/workflows/copyright_check.yml"
"*/node_modules/*" "*/build/*" "*/dist/*" "*/temp/*")
# Directory to search
search_dir="."
# Pattern to look for: 'Copyright (c)'
pattern="Copyright (c)"
exit_code=0
# Find files containing the copyright notice
echo "Checking files in $search_dir for outdated copyright years..."
echo "Current year is $current_year."
# Iterate over files, redirecting into while loop to avoid subshell
find $search_dir -type f -print0 > tmp.$$ || exit 1
while IFS= read -r -d $'\0' file; do
# Skip files in the ignore list
skip_file=false
for ignore_pattern in "${ignore_files[@]}"; do
if echo "$file" | grep -qE "$ignore_pattern"; then
skip_file=true
break
fi
done
if $skip_file; then
continue
fi
# Use grep to find the line and awk to extract the year
# If grep fails
if year_line=$(grep "$pattern" "$file"); then
if [[ -n "$year_line" ]]; then
# Extract year assuming the year is after 'Copyright (c)'
year=$(echo "$year_line" | grep -E -oh "[0-9]{4}-[0-9]{4}")
year=$(echo "$year" | awk -F'-' '{print $2}')
# Check if extracted year is not equal to the current year
if [[ "$year" -ne "$current_year" ]]; then
echo "Outdated copyright year ($year) in file: $file"
exit_code=1
fi
fi
fi
done < tmp.$$
rm tmp.$$ # Clean up temporary file
echo "Check complete."
exit $exit_code