push
Some checks failed
CI/CD Pipeline / test (push) Failing after 57s
Update CI/CD Pipeline / update (push) Failing after 1m22s

This commit is contained in:
philipp 2024-10-17 19:53:15 +02:00
parent 6fe3c2498a
commit 6c65fcc9ac

View File

@ -2,7 +2,7 @@ name: Update CI/CD Pipeline
on:
schedule:
- cron: '10 * * * *' # Runs the pipeline at the 39th minute of every hour
- cron: '54 * * * *' # Runs the pipeline at the 39th minute of every hour
env:
GITEATOKEN: ${{ secrets.GITEATOKEN }}
@ -26,7 +26,13 @@ jobs:
git config --global user.name "CI Bot"
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected. Committing and preparing to push."
if git ls-remote --exit-code --heads origin update-branch; then
echo "Branch 'update-branch' exists. Checking it out."
git checkout update-branch
else
echo "Branch 'update-branch' does not exist. Creating it."
git checkout -b update-branch
fi
git add .
git commit -m "Automated update of laws"
git push origin update-branch
@ -38,12 +44,11 @@ jobs:
- name: Create Pull Request
if: success()
run: |
echo "https://git.hofer.link/api/v1/repos/philipp/risp/pulls"
if [ -n "$(git log origin/main..HEAD)" ]; then
curl -X POST "https://git.hofer.link/api/v1/repos/philipp/risp/pulls" \
-H "Authorization: token $GITEATOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Update laws","head":"update-branch","base":"main","body":"Automated update of laws."}'
-d '{"title":"Update laws","head":"update-branch","base":"main","body":"Automated update of laws.", "assignee": "philipp"}'
else
echo "No changes to create a pull request."
fi