actions-test/newfile.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

39 lines
1 KiB
YAML

on:
push:
branches:
- main
paths-ignore:
- 'newfile'
- 'scheduled'
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 "cicd@localhost"
git config --global user.name "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 >newfile
git add newfile
- name: Commit and Push Changes
run: |
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "[skip ci] Automated update"
git push origin HEAD
fi