From 63b9bd3c5b75100b0e22efb42fd08620388a0b89 Mon Sep 17 00:00:00 2001 From: maddalax Date: Thu, 26 Sep 2024 15:44:17 -0500 Subject: [PATCH] add back action to keep modules updated with framework --- .github/workflows/update-framework-dep.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/update-framework-dep.yml diff --git a/.github/workflows/update-framework-dep.yml b/.github/workflows/update-framework-dep.yml new file mode 100644 index 0000000..ae7f144 --- /dev/null +++ b/.github/workflows/update-framework-dep.yml @@ -0,0 +1,42 @@ +name: Update HTMGO Dependencies + +on: + workflow_dispatch: # Trigger on manual workflow_dispatch + push: + branches: + - master + +jobs: + update-htmgo-dep: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + persist-credentials: false # Necessary to avoid using the runner's credentials for commit + fetch-depth: 0 # Full history for committing back changes + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ">=1.20" + + - name: Run update-htmgo-dep.go script + run: go run tools/update-htmgo-dep.go + + - name: Check if changes are present + run: | + git diff --exit-code || echo "Changes detected" + continue-on-error: true + + - name: Commit changes if any + if: steps.check_changes.outcome == 'failure' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Auto-update HTMGO dependencies" + git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}