Remove deprecated method and refactor baseline data handling. #173
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2020, 2025 Contributors to the Eclipse Foundation | |
| # | |
| # Contributors: | |
| # Thomas Jaeckle - initial API and implementation | |
| # Yufei Cai - fix head vs base ahead error | |
| # Matthias Mailänder - check all files and account for year ranges | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Eclipse Public License 2.0 which is available at | |
| # http://www.eclipse.org/legal/epl-2.0 | |
| # | |
| # SPDX-License-Identifier: EPL-2.0 | |
| name: License Header | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-license-header-year: | |
| name: Year | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Find changed Java files | |
| id: changed | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| CHANGED_FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files[] | select(.additions > 0) | .path') | |
| JAVA_FILES=$(echo "$CHANGED_FILES" | grep '\.java$' || true) | |
| echo "java=$(echo "$JAVA_FILES" | tr '\n' ' ')" >> $GITHUB_OUTPUT | |
| - name: Check year in license header | |
| shell: bash | |
| run: | | |
| current_year=$(date +'%Y') | |
| missing_counter=0 | |
| for file in ${{ steps.changed.outputs.java }}; do | |
| if grep -q "Copyright (c) $current_year" $file; then | |
| printf "\xE2\x9C\x94 $file\n" | |
| elif grep -q "Copyright (c) [0-9]\{4\}, $current_year" $file; then | |
| printf "\xE2\x9C\x94 $file\n" | |
| else | |
| printf "\xE2\x9D\x8C $file\n\tCopyright header with '$current_year' is missing from changed file.\n" | |
| missing_counter=$(expr $missing_counter + 1) | |
| fi | |
| done | |
| exit $missing_counter |