push
This commit is contained in:
parent
6fe3c2498a
commit
6c65fcc9ac
@ -2,7 +2,7 @@ name: Update CI/CD Pipeline
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
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:
|
env:
|
||||||
GITEATOKEN: ${{ secrets.GITEATOKEN }}
|
GITEATOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
@ -26,7 +26,13 @@ jobs:
|
|||||||
git config --global user.name "CI Bot"
|
git config --global user.name "CI Bot"
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
echo "Changes detected. Committing and preparing to push."
|
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 add .
|
||||||
git commit -m "Automated update of laws"
|
git commit -m "Automated update of laws"
|
||||||
git push origin update-branch
|
git push origin update-branch
|
||||||
@ -38,12 +44,11 @@ jobs:
|
|||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
echo "https://git.hofer.link/api/v1/repos/philipp/risp/pulls"
|
|
||||||
if [ -n "$(git log origin/main..HEAD)" ]; then
|
if [ -n "$(git log origin/main..HEAD)" ]; then
|
||||||
curl -X POST "https://git.hofer.link/api/v1/repos/philipp/risp/pulls" \
|
curl -X POST "https://git.hofer.link/api/v1/repos/philipp/risp/pulls" \
|
||||||
-H "Authorization: token $GITEATOKEN" \
|
-H "Authorization: token $GITEATOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-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
|
else
|
||||||
echo "No changes to create a pull request."
|
echo "No changes to create a pull request."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user