-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to the Git Commit Push Action step in the Add License workflow
- Loading branch information
1 parent
0b78e05
commit 691c7ac
Showing
1 changed file
with
6 additions
and
18 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 |
---|---|---|
|
@@ -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 |