From eb1a6d96cf6315acf40f4e08c4e54206fa07b3a3 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Sat, 4 Oct 2025 07:42:05 -0400 Subject: [PATCH] PR creation specificity and README generation. --- .gitea/workflows/pr-docker-deploy.yml | 76 ++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/pr-docker-deploy.yml b/.gitea/workflows/pr-docker-deploy.yml index cd22e0c..a6c0ecf 100644 --- a/.gitea/workflows/pr-docker-deploy.yml +++ b/.gitea/workflows/pr-docker-deploy.yml @@ -42,7 +42,7 @@ jobs: with: gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" - notification_title: "GITEA: PR Check" + notification_title: "GITEA: PR Check @ Benedikta" notification_message: "Checking for existing PR... 🔍" - name: Check if open PR exists @@ -66,7 +66,7 @@ jobs: with: gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" - notification_title: "GITEA: PR Check" + notification_title: "GITEA: PR Check @ Benedikta" notification_message: "PR Created 🎟️" generate-service-list: @@ -266,6 +266,78 @@ jobs: notification_title: "GITEA: Docker Compose Dry Run @ Benedikta" notification_message: "Docker Compose dry run completed successfully." + regenerate-readme-modified-services: + name: Update README & Generate List of Modified Services + runs-on: ubuntu-latest + needs: [docker-compose-dry-run] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install yq + uses: dcarbone/install-yq-action@v1.3.1 + + - name: Gotify Notification + uses: eikendev/gotify-action@master + with: + gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" + gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" + notification_title: "GITEA: README Update" + notification_message: "Updating README..." + + - name: Find docker-compose YAML files + id: find-compose-files + run: | + COMPOSE_FILES=$(find . -type f -name "docker-compose*.yml" \ + -a ! -name "*windows*" \ + -a ! -name "*gui*" \ + -a ! -name "*macos*" \ + -a ! -name "*hivemind*" \ + -a ! -name "*server*" \ + | sort) + echo "compose_files=$COMPOSE_FILES" >> "$GITHUB_OUTPUT" + echo "Found Compose files:" + echo "$COMPOSE_FILES" + + - name: Generate combined service list + run: | + echo "[]" > combined_services.json + for f in ${{ steps.find-compose-files.outputs.compose_files }}; do + echo "Processing $f" + yq '.services | to_entries | map({"service": .key, "image": .value.image})' "$f" \ + >> temp_services.json + done + + # Merge all service arrays into one + jq -s add temp_services.json | jq 'unique_by(.service)' > services.json + + - name: Generate Markdown Table + uses: gazab/create-markdown-table@v1.0.7 + id: service-table + with: + file: ./services.json + + - name: Regenerate README + run: | + echo "# List of Services" > README.md + echo -e "\n\n" >> README.md + echo "${{ steps.service-table.outputs.table }}" >> README.md + + - name: Add/Commit README.md + id: commit-readme + uses: EndBug/add-and-commit@v9.1.4 + with: + message: "chore: Update README" + add: "README.md" + + - name: Gotify Notification + uses: eikendev/gotify-action@master + with: + gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}" + gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}" + notification_title: "GITEA: README Update" + notification_message: "README updated" + pr-merge: name: PR Merge needs: [generate-service-list, docker-compose-dry-run]