Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make dependabot work with changesets #2287

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/dependabot-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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: |
pnpm dlx changeset 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 }}
Loading