actions-test/scheduled.yaml
Ari Archer ff27354c80
remove CI SKIP and replace it with [skip ci]
Signed-off-by: Ari Archer <ari@ari.lt>
2024-06-21 01:33:51 +03:00

35 lines
1 KiB
YAML

on:
schedule:
- cron: '0 0 * * *'
jobs:
modify-and-push:
runs-on: docker
steps:
- name: Checkout Repository
run: |
git clone https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@git.ari.lt/ari/actions-test.git .
git config --global user.email "scheduled.cicd@localhost"
git config --global user.name "Scheduled CI/CD"
- name: Check for Skip CI in Last Commit
id: check_commit
run: |
commit_message=$(git log -1 --pretty=%B)
if echo "$commit_message" | grep -q "\[skip ci\]"; then
echo "Skip CI based on commit message" && exit 78;
fi
- name: Make Changes to a File
run: |
date >scheduled
git add scheduled
- name: Commit and Push Changes
run: |
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "[skip ci] Scheduled update"
git push origin HEAD
fi