Skip to content

Commit 809240c

Browse files
committed
Fail CI when the license copyright year is behind the current year
1 parent d9e16c5 commit 809240c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎.github/workflows/python-package.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
16+
- name: Check the license copyright year is current
17+
run: |
18+
year="$(date -u +%Y)"
19+
license_year="$(grep -m1 '^Copyright' LICENSE.md | grep -oE '[0-9]{4}' | tail -1)"
20+
if [ "$license_year" != "$year" ]; then
21+
echo "::error file=LICENSE.md::Copyright year $license_year is not the current year $year; update LICENSE.md" >&2
22+
exit 1
23+
fi
1624
- name: Set up Python
1725
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1826
with:

0 commit comments

Comments
 (0)