Skip to content

Commit aaee5ad

Browse files
authored
ci: open PR instead of direct push in dependabot update workflow (#424)
1 parent 0c0b608 commit aaee5ad

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/dependabot.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,24 @@ jobs:
3434
- name: Run tests
3535
run: npm test
3636

37-
- name: Commit and push changes
37+
- name: Commit and open PR
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3840
run: |
3941
git config user.name "github-actions[bot]"
4042
git config user.email "github-actions[bot]@users.noreply.github.com"
41-
43+
4244
if ! git diff --quiet; then
45+
BRANCH="chore/update-dependencies-$(date +%Y%m%d-%H%M%S)"
46+
git checkout -b "$BRANCH"
4347
git add -A
4448
git commit -m "chore: update dependencies"
45-
git push
49+
git push origin "$BRANCH"
50+
gh pr create \
51+
--base gh-pages \
52+
--head "$BRANCH" \
53+
--title "chore: update dependencies" \
54+
--body "Automated dependency update via \`npm update\` and bundle rebuild."
4655
else
4756
echo "No changes to commit"
4857
fi

0 commit comments

Comments
 (0)