Skip to content

Commit

Permalink
Update delete-license-key.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattsoria authored Jan 17, 2024
1 parent 7d61508 commit dc4eebd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/delete-license-key.yml
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
Expand All @@ -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 }}

0 comments on commit dc4eebd

Please sign in to comment.