pr_workflow #42
@ -49,14 +49,30 @@ jobs:
|
|||||||
--limit "10"
|
--limit "10"
|
||||||
|
|
||||||
- name: Commit and push results
|
- name: Commit and push results
|
||||||
|
id: commit_step
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "gitea-actions[bot]"
|
git config --global user.name "gitea-actions[bot]"
|
||||||
git config --global user.email "actions@users.noreply.local"
|
git config --global user.email "actions@users.noreply.local"
|
||||||
git checkout -B analytics-update
|
git checkout -B analytics-update
|
||||||
git add analytics/
|
git add analytics/
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No changes to commit"
|
echo "ANALYTICS_CHANGES=false" >> $GITEA_ENV
|
||||||
else
|
else
|
||||||
git commit -m "chore: update analytics data [skip ci]"
|
git commit -m "chore: update analytics data"
|
||||||
git push origin analytics-update --force
|
git push origin analytics-update --force
|
||||||
|
echo "ANALYTICS_CHANGES=true" >> $GITEA_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Create Pull Request in Gitea
|
||||||
|
if: env.ANALYTICS_CHANGES == 'true'
|
||||||
|
run: |
|
||||||
|
curl -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
https://gitea.eco.tsi-dev.otc-service.com/api/v1/repos/infra/otc-metadata-rework/pulls \
|
||||||
|
-d '{
|
||||||
|
"title": "chore: weekly update analytics data",
|
||||||
|
"head": "analytics-update",
|
||||||
|
"base": "main",
|
||||||
|
"body": "Auto-Update of Analytics-data"
|
||||||
|
}'
|
||||||
|
Reference in New Issue
Block a user