fix: improve CI workflows and README documentation
This commit is contained in:
1 parent
8f1e227d50
commit
693b4a42f6
3 files changed
+126
-20
No files matched your search
@@ -13,7 +13,6 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.CI_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
@@ -39,20 +38,38 @@ jobs:
|
||||
cd backend/playout && go get -u ./... && go mod tidy
|
||||
cd ../chat && go get -u ./... && go mod tidy
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.CI_REGISTRY_TOKEN }}
|
||||
commit-message: "chore: update dependencies"
|
||||
title: "chore: weekly dependency updates"
|
||||
body: |
|
||||
Automated weekly dependency updates.
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config user.name "linearvoid-bot"
|
||||
git config user.email "bot@linearvoid.local"
|
||||
git add frontend/package*.json backend/playout/go.* backend/chat/go.*
|
||||
if git diff --cached --quiet; then
|
||||
echo "No dependency changes detected."
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "chore: update dependencies"
|
||||
git push origin HEAD:dependency-updates --force
|
||||
|
||||
This PR updates:
|
||||
- Frontend npm dependencies
|
||||
- Go module dependencies
|
||||
|
||||
Please review the changes and ensure tests pass before merging.
|
||||
branch: dependency-updates
|
||||
delete-branch: true
|
||||
labels: dependencies, automated
|
||||
- name: Create Pull Request via Gitea API
|
||||
run: |
|
||||
RESPONSE=$(curl -s -o /tmp/pr-response.json -w "%{http_code}" \
|
||||
-X POST "$CI_SERVER_URL/api/v1/repos/zwitschi/linearvoid/pulls" \
|
||||
-H "Authorization: token ${{ secrets.CI_REGISTRY_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"title": "chore: weekly dependency updates",
|
||||
"head": "dependency-updates",
|
||||
"base": "main",
|
||||
"body": "Automated weekly dependency updates.\n\nThis PR updates:\n- Frontend npm dependencies\n- Go module dependencies\n\nPlease review the changes and ensure tests pass before merging."
|
||||
}')
|
||||
if [ "$RESPONSE" -eq 201 ]; then
|
||||
PR_URL=$(cat /tmp/pr-response.json | jq -r '.html_url')
|
||||
echo "PR created: $PR_URL"
|
||||
elif [ "$RESPONSE" -eq 409 ]; then
|
||||
echo "PR already exists. Pushing updated commits..."
|
||||
git push origin dependency-updates --force
|
||||
else
|
||||
echo "Error creating PR (HTTP $RESPONSE):"
|
||||
cat /tmp/pr-response.json
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user