From 9016fb217ed8c873c57048808d5594e20a6f0536 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 11 Nov 2025 11:15:08 +0000 Subject: [PATCH] ci(github/workflows): add dependabot rebuild workflow (#39) --- .github/workflows/dependabot-rebuild.yml | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/dependabot-rebuild.yml diff --git a/.github/workflows/dependabot-rebuild.yml b/.github/workflows/dependabot-rebuild.yml new file mode 100644 index 0000000..e9ff405 --- /dev/null +++ b/.github/workflows/dependabot-rebuild.yml @@ -0,0 +1,44 @@ +--- +name: Dependabot Rebuild + +on: + pull_request: + types: [opened, synchronize] + +permissions: + contents: write + pull-requests: read + +jobs: + rebuild-dist: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.event.sender.login == 'dependabot[bot]' }} + steps: + - name: Generate app token + id: app-token + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 + with: + app-id: ${{ secrets.RELEASE_BOT_APP_ID }} + private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + token: ${{ steps.app-token.outputs.token }} + ref: ${{ github.head_ref }} + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - name: Rebuild dist + run: npm run bundle + - name: Commit and push if changed + run: | + if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add dist/ + git commit -m "chore: rebuild dist" + git push + else + echo "No changes to dist/" + fi