Skip to content

Commit 5dca25c

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/js-yaml-4.2.0
2 parents 96af6a9 + bfc0a71 commit 5dca25c

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

‎.github/workflows/dependabot-changeset.yml‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)