File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,16 +64,24 @@ jobs:
6464 run : |
6565 git config user.name "github-actions[bot]"
6666 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
67- CHANGED=false
68- if [ -n "$(git status --porcelain pnpm-lock.yaml)" ]; then
69- git add pnpm-lock.yaml
70- CHANGED=true
71- fi
67+ ADDED_CHANGESET=false
68+ ADDED_LOCKFILE=false
7269 if [ "${{ steps.check.outputs.exists }}" == 'false' ]; then
7370 git add ".changeset/dependabot-pr-${{ steps.pr.outputs.number }}.md"
74- CHANGED=true
71+ ADDED_CHANGESET=true
72+ fi
73+ if [ -n "$(git status --porcelain pnpm-lock.yaml)" ]; then
74+ git add pnpm-lock.yaml
75+ ADDED_LOCKFILE=true
7576 fi
76- if [ "$CHANGED" = true ]; then
77- git commit -m "chore: add changeset and update lockfile for dependabot PR #${{ steps.pr.outputs.number }}"
77+ if [ "$ADDED_CHANGESET" = true ] || [ "$ADDED_LOCKFILE" = true ]; then
78+ if [ "$ADDED_CHANGESET" = true ] && [ "$ADDED_LOCKFILE" = true ]; then
79+ MSG="chore: add changeset and update lockfile for dependabot PR #${{ steps.pr.outputs.number }}"
80+ elif [ "$ADDED_CHANGESET" = true ]; then
81+ MSG="chore: add changeset for dependabot PR #${{ steps.pr.outputs.number }}"
82+ else
83+ MSG="chore: update lockfile for dependabot PR #${{ steps.pr.outputs.number }}"
84+ fi
85+ git commit -m "$MSG"
7886 git push
7987 fi
You can’t perform that action at this time.
0 commit comments