Skip to content

Update delete-license-key.yml #3

Update delete-license-key.yml

Update delete-license-key.yml #3

name: Delete File and Commit Changes
on:
push:
branches:
- main
jobs:
delete-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Delete File and Commit Changes
run: |
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 }}