-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 973 Bytes
/
remove.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Delete st.ps1 on Push
on:
push:
branches:
- main # Change this if needed
permissions:
contents: write # Ensure GITHUB_TOKEN has write permissions
jobs:
delete_file:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Remove the file if it exists
- name: Remove st.ps1 if it exists
run: |
if [ -f "st.ps1" ]; then
git rm st.ps1
fi
# Step 3: Commit the changes
- name: Commit changes
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git commit -m "Delete st.ps1 if exists" || echo "No changes to commit"
# Step 4: Push the changes using GITHUB_TOKEN
- name: Push changes
run: |
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}