feat: add update-manifests workflow
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
name: Update manifest chart versions
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 1" # Every Monday at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-manifests:
|
||||
runs-on: [self-hosted, nix]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Scan manifests for chart version updates
|
||||
run: |
|
||||
echo "TODO: implement manifest update scanning"
|
||||
echo ""
|
||||
echo "Planned implementation:"
|
||||
echo " 1. Parse each manifests/*/chart.yaml for HelmRelease chart versions"
|
||||
echo " 2. Query artifact hub or helm repo for latest versions"
|
||||
echo " 3. Emit a diff of available updates"
|
||||
echo ""
|
||||
echo "Scanned manifests directories:"
|
||||
ls manifests/
|
||||
|
||||
- name: Create PR if changes found
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.KLAATU_TOKEN }}
|
||||
GITEA_URL: https://src.thehellings.com
|
||||
REPO: greg/nixos
|
||||
run: |
|
||||
if git diff --quiet; then
|
||||
echo "No manifest changes, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
BRANCH="auto/update-manifests-$(date +%Y%m%d)"
|
||||
git config user.email "klaatu@thehellings.com"
|
||||
git config user.name "klaatu"
|
||||
git checkout -b "$BRANCH"
|
||||
git add manifests/
|
||||
git commit -m "chore: update manifest chart versions $(date +%Y-%m-%d)"
|
||||
|
||||
git remote set-url origin "https://klaatu:${GITEA_TOKEN}@${GITEA_URL#https://}/${REPO}.git"
|
||||
git push origin "$BRANCH"
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/pulls" \
|
||||
-d "{
|
||||
\"title\": \"chore: update manifest chart versions $(date +%Y-%m-%d)\",
|
||||
\"head\": \"$BRANCH\",
|
||||
\"base\": \"main\",
|
||||
\"body\": \"Automated weekly manifest chart version update.\\n\\nGenerated by Gitea Actions.\",
|
||||
\"assignees\": [\"greg\"]
|
||||
}"
|
||||
Reference in New Issue
Block a user