From 5d72639fbae093d44d61c2b1e54be7a49d699c4d Mon Sep 17 00:00:00 2001 From: maddalax Date: Thu, 26 Sep 2024 15:06:04 -0500 Subject: [PATCH] update framework deps on commit --- .github/workflows/update-framework-dep.yml | 40 ++++++++++++++++++++++ 1 file changed, 40 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..f1fb08d --- /dev/null +++ b/.github/workflows/update-framework-dep.yml @@ -0,0 +1,40 @@ +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" + + - name: Commit changes if any + if: success() && steps.commit.outputs.changes_detected == 'Changes detected' + 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 origin master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}