From 88a073fe8529f8ce211eb4420850987944944e6a Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Sat, 8 Oct 2022 14:17:48 +0200 Subject: [PATCH] Fix dependabot workflow --- .github/workflows/update-dist.yaml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-dist.yaml b/.github/workflows/update-dist.yaml index 714f203..e316519 100644 --- a/.github/workflows/update-dist.yaml +++ b/.github/workflows/update-dist.yaml @@ -1,18 +1,29 @@ name: Dependabot PR on: pull_request: - types: [opened, synchronize, edited, reopened] - branches: - - dependabot/** + types: [opened, reopened, synchronize] jobs: + print-info: + name: Update dist + runs-on: ubuntu-22.04 + + steps: + - name: Print PR info + run: | + echo Ref: ${{ github.ref }} + echo Head-Ref: ${{ github.head_ref }} + echo Actor: ${{ github.actor }} + update-dist: name: Update dist runs-on: ubuntu-22.04 if: > - startsWith(github.head_ref, 'dependabot/npm_and_yarn') && + startsWith(github.ref, 'refs/heads/dependabot/npm_and_yarn') && github.actor == 'dependabot[bot]' + needs: [print-info] + permissions: contents: write @@ -37,7 +48,7 @@ jobs: run: yarn build - name: Commit new dist - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v4.15.0 with: file_pattern: dist commit_message: Build dist @@ -46,7 +57,7 @@ jobs: name: Update dist runs-on: ubuntu-22.04 if: > - startsWith(github.head_ref, 'dependabot/npm_and_yarn') && + startsWith(github.ref, 'refs/heads/dependabot/npm_and_yarn') && github.actor == 'dependabot[bot]' needs: [update-dist] @@ -65,7 +76,7 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Approve a PR - if: ${{ steps.dependabot-metadata.outputs.update-type == "version-update:semver-patch" }} + if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }} run: | gh pr checkout "$PR_URL" [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ] \