-
Notifications
You must be signed in to change notification settings - Fork 78
38 lines (33 loc) · 1.31 KB
/
dependabot-changeset.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Dependabot Changeset
on:
pull_request:
types: [opened, synchronize]
jobs:
create-changeset:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/turbo-build
with:
node-version: '20'
- name: Create Changeset
run: |
pnpx @changesets/cli add --empty
echo "# Dependabot update" >> .changeset/dependabot-update.md
echo "" >> .changeset/dependabot-update.md
echo "Updated dependencies:" >> .changeset/dependabot-update.md
echo "\`\`\`" >> .changeset/dependabot-update.md
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep package.json | xargs -I {} sh -c 'echo "- {}"' >> .changeset/dependabot-update.md
echo "\`\`\`" >> .changeset/dependabot-update.md
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .changeset
git commit -m "Add changeset for Dependabot update"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}