-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
322965f
commit 714a562
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Add Headers to Source Files | ||
|
||
on: | ||
push: | ||
branches: | ||
- add-comments-top-file-ci | ||
|
||
jobs: | ||
add-headers: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check and Prepend Comments | ||
run: | | ||
for file in $(find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.cs" \)); do | ||
if ! grep -q "Copyright 2023 Quantoz Technology B.V. and contributors." "$file"; then | ||
echo -e "// Copyright 2023 Quantoz Technology B.V. and contributors. Licensed\n// under the Apache License, Version 2.0. See the NOTICE file at the root\n// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0\n\n$(cat $file)" > $file | ||
fi | ||
done | ||
- name: Commit and Push Changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add -A | ||
if [[ $(git diff --cached) ]]; then | ||
git commit -m "Add headers to source files" | ||
git push | ||
else | ||
echo "No changes to commit" | ||
fi |
This file contains 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