Files
homelab/.gitea/workflows/write-new-template.yml
Alex Frantz cd68af81c6
All checks were successful
Deploy Containers / Prepare (push) Successful in 4s
delete branch after creation
2025-11-21 03:01:44 -05:00

46 lines
1.5 KiB
YAML

name: Create New Secrets Template
on:
workflow_dispatch:
jobs:
create-pr:
name: Extract updated template
runs-on: runner
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run extraction script
run: |
echo "${{ secrets.VAULT_PASS }}" > ~/.vault_pass.txt
python3 scripts/extract_to_template.py
- name: Commit changes
run: |
git config user.name "Service Account"
git config user.email "alex+homelab@alexav.gg"
git checkout -b template-extraction-${{ github.run_number }}
git add .
git commit -m "Automated template extraction"
git push origin template-extraction-${{ github.run_number }}
- name: Create Pull Request
run: |
curl -X POST \
"https://git.alexav.gg/api/v1/repos/alex/homelab/pulls" \
-H "Authorization: token ${{ secrets.TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"title": "Automated Template Extraction",
"body": "Updates the `all.template.yml` file with latest secrets for services",
"head": "template-extraction-${{ github.run_number }}",
"base": "main"
}'
- name: Delete Branch
run: |
curl -X DELETE \
"https://git.alexav.gg/api/v1/repos/alex/homelab/branches/template-extraction-${{ github.run_number }}" \
-H "Authorization: token ${{ secrets.TOKEN }}"