-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dependabot changeset gh actions (#2289)
- Loading branch information
1 parent
7e14aab
commit 200fad2
Showing
1 changed file
with
12 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,20 @@ | ||
name: Dependabot Changeset | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
pull_request_target: | ||
types: [opened, synchronize, labeled] | ||
|
||
jobs: | ||
create-changeset: | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
renovate: | ||
name: Update Renovate PR | ||
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 | ||
if: contains(github.event.pull_request.labels.*.name, 'dependencies') | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "action@github.com" | ||
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 | ||
steps: | ||
- name: Update PR | ||
uses: mscharley/dependency-changesets-action@v1.0.5 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.head_ref }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
use-conventional-commits: true | ||
author-name: GitHub Action | ||
author-email: action@github.com |