-
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.
- Loading branch information
1 parent
7d61508
commit dc4eebd
Showing
1 changed file
with
11 additions
and
8 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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
name: Delete License Key and Commit Changes | ||
name: Delete File and Commit Changes | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
delete-commit: | ||
runs-on: ubuntu-latest | ||
|
@@ -17,13 +15,18 @@ jobs: | |
|
||
- name: Delete File and Commit Changes | ||
run: | | ||
rm app/config/license.key | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Delete license.key file" | ||
rm -f app/config/license.key # Use '-f' flag to suppress error if the file doesn't exist | ||
if git status --porcelain | grep 'app/config/license.key'; then | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Delete license.key file" | ||
else | ||
echo "Nothing to commit. File does not exist." | ||
fi | ||
- name: Push Changes | ||
if: ${{ !contains(github.event.head_commit.message, 'Delete license.key file') }} # Skip push if no changes were committed | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |