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

[skip ci] #114

Open
wants to merge 3 commits into
base: feat-package-last-commit
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
31 changes: 31 additions & 0 deletions .github/workflows/package_for_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,37 @@ jobs:
with:
ref: refs/pull/${{ github.event.issue.number }}/merge

- name: Check without commit after comment
uses: actions/github-script@v7
if: ${{ github.event_name == 'issue_comment' }}
env:
ISSUE_NUMBER: ${{github.event.issue.number}}
COMMENT_ID: ${{ github.event.comment.id }}
with:
script: |
const { ISSUE_NUMBER, COMMENT_ID } = process.env
let page = 1
let hasFoundComment = false
while(true) {
const { data: timelines } = await github.rest.issues.listEventsForTimeline({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ISSUE_NUMBER,
page,
per_page: 100,
})
if (timelines.some(v => {
hasFoundComment = hasFoundComment || (v.event === 'commented' && `${v.id}` === `${COMMENT_ID}`)
return hasFoundComment && v.event === 'committed'
})) {
throw new Error('The last commit comes after the comment, please comment and package after last commit')
}
if (timelines.length === 0) {
return
}
page += 1
}

- name: Setup Node
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ You will need `node >= 18.12.0` and `yarn >= 1.14` to build and run Neuron.

#### Lerna



This project uses [lerna](https://github.com/lerna/lerna/) for package management.

```shell
Expand Down