push
This commit is contained in:
parent
6fe3c2498a
commit
6c65fcc9ac
@ -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."
|
||||
git checkout -b update-branch
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user