diff --git a/.github/workflows/package-dependabot.yml b/.github/workflows/package-dependabot.yml new file mode 100644 index 0000000..0287a3a --- /dev/null +++ b/.github/workflows/package-dependabot.yml @@ -0,0 +1,42 @@ +name: Refresh Dependabot action bundle + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + +permissions: + contents: write + +concurrency: + group: package-dependabot-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + package: + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: true + - uses: actions/setup-node@v6 + with: + node-version: '24.19.0' + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn build + - name: Commit updated action bundle + env: + BRANCH: ${{ github.event.pull_request.head.ref }} + EXPECTED_SHA: ${{ github.event.pull_request.head.sha }} + run: | + if git diff --quiet -- dist; then + exit 0 + fi + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add -- dist + git commit -m 'chore: rebuild packaged action for dependency update' + git push origin "HEAD:refs/heads/$BRANCH" --force-with-lease="refs/heads/$BRANCH:$EXPECTED_SHA"