Security Check #13369
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
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 |