-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (25 loc) · 923 Bytes
/
schedule.yml
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
name: Security Check
on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *'
jobs:
process-queue:
runs-on: ubuntu-latest
steps:
- name: Login and check for changes
uses: garygrossgarten/github-action-ssh@release
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
privateKey: ${{ secrets.SSH_KEY }}
command: |
cd ~/providencedenver.org/web
status=$(git status)
if [[ $status =~ "Untracked files:" && $status =~ "wp-content/plugins/insert-headers-and-footers/" ]]; then
rm -rf wp-content/plugins/insert-headers-and-footers/
log_file="$HOME/github_action_security_check.txt"
current_date=$(date +"%Y-%m-%d %H:%M:%S")
log_message="Logged at: $current_date"
echo "$log_message" > "$log_file"
fi