Skip to content

Commit

Permalink
Migrate to the Git Commit Push Action step in the Add License workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamdby committed Mar 18, 2024
1 parent 0b78e05 commit 691c7ac
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/add-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,18 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to retrieve full commit history
persist-credentials: false # Required to allow the use of the token to push back to the repository

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.10"

- name: Add License
run: |
python scripts/add_license.py
- name: Check for file changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::set-output name=changes::true"
else
echo "::set-output name=changes::false"
fi
- name: Commit changes
if: steps.changes.outputs.changes == true
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git add .
git commit -m "Add license to files"
git push
- uses: GuillaumeFalourd/[email protected]
with:
commit_message: "Add license to files"
target_branch: main

0 comments on commit 691c7ac

Please sign in to comment.