-
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 a10e1fb
Showing
2 changed files
with
30 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,30 @@ | ||
name: Prepend Comments | ||
|
||
on: | ||
push: | ||
branches: | ||
- add-comments-top-file-ci | ||
|
||
jobs: | ||
prepend-comments: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepend comments to files | ||
run: | | ||
for file in $(find . -name '*.cs' -o -name '*.ts' -o -name '*.tsx' -o -name '*.js'); do | ||
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 | ||
done | ||
- name: Commit and push if changed | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git add -A | ||
if [[ $(git status --porcelain) ]]; then | ||
git commit -m "Prepend comments to source files" | ||
git push | ||
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