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

Dependabot #188

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/metal-grapes-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mysten/suins": patch
---

@mysten/sui update
6 changes: 6 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
addReviewers: true
addAssignees: false
reviewers:
- leecchh
- manolisliolios
numberOfReviewers: 0
57 changes: 57 additions & 0 deletions .github/workflows/dependabot_review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Auto-Assign Reviewers and Run pnpm changeset for Dependabot PRs

on:
pull_request_target:
types: [opened, synchronize]

jobs:
run-changeset:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Create changeset file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do it that way (too hacky). There must be a way to utilize pnpm changeset on the root directory to create a patch.

run: |
echo "---" > .changeset/metal-grapes-flow.md
echo "\"@mysten/suins\": patch" >> .changeset/metal-grapes-flow.md
echo "---" >> .changeset/metal-grapes-flow.md
echo "" >> .changeset/metal-grapes-flow.md
echo "@mysten/sui update" >> .changeset/metal-grapes-flow.md

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit and push changes
env:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git add .
git commit -m "changeset"
git push origin HEAD:$PR_HEAD_REF

assign-reviewers:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Assign Reviewers
uses: kentaro-m/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}