diff --git a/.github/workflows/java.yaml b/.github/workflows/java.yaml index fd459fc..8117a24 100644 --- a/.github/workflows/java.yaml +++ b/.github/workflows/java.yaml @@ -9,6 +9,29 @@ on: - cron: '0 0 * * *' jobs: + check-copyright: + name: Check Copyright + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check Copyright + env: + EXTENSIONS: "*.java, *.js" + COPYRIGHT_STATEMENT: "/**\n * Copyright IBM Corp. 2024\n */" + run: | + for ext in $EXTENSIONS; do + for file in $(find . -type f -name "$ext" ! -path "cics-java-liberty-jdbc-web/*"); do + if ! grep -q "Copyright" "$file"; then + echo -e "$COPYRIGHT_STATEMENT\n$(cat "$file")" > "$file" + fi + done + done + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ github.head_ref }} + build-mvnw: name: Build Maven Wrapper diff --git a/cics-java-liberty-jdbc-web/src/main/webapp/scripts/employee.js b/cics-java-liberty-jdbc-web/src/main/webapp/scripts/employee.js index 4e91e41..8eb1fb0 100644 --- a/cics-java-liberty-jdbc-web/src/main/webapp/scripts/employee.js +++ b/cics-java-liberty-jdbc-web/src/main/webapp/scripts/employee.js @@ -1,3 +1,6 @@ +/** + * Copyright IBM Corp. 2024 + */ /** The information element */ const information = document.getElementById("information"); const errorMessage = document.getElementById("error"); @@ -74,4 +77,4 @@ async function addEmployee(employee) { } // Start loading the employees -loadEmployees(); \ No newline at end of file +loadEmployees();