🐛 Fix logger #20
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
name: Add Comment to Files | |
on: [push] | |
jobs: | |
add_comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Save current file list | |
id: save_file_list | |
run: | | |
git ls-files > before_files.txt | |
- name: Run script to add comment | |
run: | | |
python utils/addCopyright.py | |
- name: List affected files | |
run: | | |
git ls-files > after_files.txt | |
git diff --name-only > affected_files.txt | |
echo "Changed files:" | |
cat affected_files.txt | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m ":construction_worker: Add copyright to files" || echo "No changes to commit" | |
git pull --rebase | |
git push origin main | |
- name: Print affected files | |
if: success() | |
run: | | |
echo "The following files were affected by the change:" | |
cat affected_files.txt |