chore: update comment label action and repro document (#399)

* chore: fix can not assign assignee on issue

* chore: update checkout action version

* chore: update action branch

* chore: update action and jobs name

* chore: update action add null check

* doc: add repro document

* chore: update comment issue action
This commit is contained in:
Argo 2023-01-27 00:36:26 -08:00 committed by GitHub
parent db3b73c7c8
commit f3d1c2cda7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 66 additions and 45 deletions

View File

@ -1,4 +1,4 @@
name: Auto Assign Issue(bot)
name: auto assign issue(bot)
on:
issues:
@ -6,22 +6,21 @@ on:
jobs:
assign_assignee:
name: Assign Assignees
name: assign assignees
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
console.log(context)
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: [context.repo.owner]
assignees: [context.actor]
})
assign_label:
name: Assign Label
name: assign label
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.5
@ -33,7 +32,7 @@ jobs:
include-title: 1
assign_miletone:
name: Assign Milestone
name: assign milestone
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6

View File

@ -1,4 +1,4 @@
name: Auto Comment on Issue(bot)
name: auto comment on issue(bot)
on:
issues:
@ -6,20 +6,16 @@ on:
jobs:
comment:
name: Comment Issue
name: comment issue
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const issue = await github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
})
const content = `@${context.payload.issue.user.login}. Thank you for filing this issue. In order for us to investigate this issue, please provide [a minimalistic repro project](https://github.com/dotnetcore/bootstrapblazor/blob/main/docs/repro.md) that illustrates the problem.`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Thanks for reporting! @' + issue.data.user.login + ' Please provide your code. If it is already provided, please ignore this message.'
body: content
})

View File

@ -1,19 +1,18 @@
name: Auto PR Test(bot)
name: auto PR test(bot)
on:
pull_request:
branches:
- master
- main
- dev
jobs:
run_test:
name: Run UnitTest
name: run test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1

View File

@ -3,16 +3,15 @@ name: Build Project
on:
push:
branches:
- master
- main
- dev
- dev-table
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1

View File

@ -1,4 +1,4 @@
name: Sync Issue to PR(bot)
name: sync issue to PR(bot)
on:
pull_request:
@ -6,7 +6,7 @@ on:
jobs:
sync_assignees:
name: Sync Assignees
name: sync assignees
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
@ -15,7 +15,7 @@ jobs:
const body = context.payload.pull_request.body
const matches = body.match(/#(\d+)/)
if (!matches || matches.length <= 1) {
console.log('This PR has no related issue!')
console.log('this PR has no related issue!')
}
else {
const related_issue_number = matches[1]
@ -24,8 +24,8 @@ jobs:
repo: context.repo.repo,
issue_number: related_issue_number
})
if(issue.data.length == 0) {
console.log(`There no labels on issue \#${related_issue_number}`)
if (issue.data.length == 0 || issue.data.assignees.length == 0) {
console.log(`there no assignees on issue \#${related_issue_number}`)
}
else {
const assignees = issue.data.assignees.map(v => v.login)
@ -35,11 +35,12 @@ jobs:
issue_number: context.issue.number,
assignees: assignees
})
console.log('Sync assignees', assignees)
console.log('sync assignees', assignees)
}
}
sync_labels:
name: Sync Labels
name: sync labels
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
@ -48,7 +49,7 @@ jobs:
const body = context.payload.pull_request.body
const matches = body.match(/#(\d+)/)
if (!matches || matches.length <= 1) {
console.log('This PR has no related issue!')
console.log('this PR has no related issue!')
}
else {
const related_issue_number = matches[1]
@ -58,7 +59,7 @@ jobs:
issue_number: related_issue_number
})
if(labels.data.length == 0) {
console.log(`There no labels on issue #${related_issue_number}`)
console.log(`there no labels on issue #${related_issue_number}`)
}
else {
const issue_labels = labels.data.map(v => v.name)
@ -68,11 +69,12 @@ jobs:
issue_number: context.issue.number,
labels: issue_labels
})
console.log('Sync labels', issue_labels)
console.log('sync labels', issue_labels)
}
}
sync_milestone:
name: Sync Milestone
name: sync milestone
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
@ -81,7 +83,7 @@ jobs:
const body = context.payload.pull_request.body
const matches = body.match(/#(\d+)/)
if (!matches || matches.length <= 1) {
console.log('This PR has no related issue!')
console.log('this PR has no related issue!')
}
else {
const related_issue_number = matches[1]
@ -90,8 +92,8 @@ jobs:
repo: context.repo.repo,
issue_number: related_issue_number
})
if(issue.data.length == 0) {
console.log(`There no labels on issue \#${related_issue_number}`)
if (issue.data.length == 0 || issue.data.milestone == null) {
console.log(`there no milestone on issue \#${related_issue_number}`)
}
else {
const milestone = issue.data.milestone
@ -101,6 +103,6 @@ jobs:
issue_number: context.issue.number,
milestone: milestone.number
})
console.log(`Sync milestone ${milestone.title}`)
console.log(`sync milestone ${milestone.title}`)
}
}

26
docs/repro.md Normal file
View File

@ -0,0 +1,26 @@
# Bug Report Reproduction Guide
When customers plan to report an issue with BootstrapBlazor, we will most likely ask them to provide a so called `minimal reproduction project (repro)`.
This serves two purposes:
- It helps issue reporters validate their assumptions by trying to recreate the behavior in a new project.
- It helps eliminate ambiguity and speeds up investigations. We may also be able to provide workarounds in certain scenarios.
This document describes what a minimal repro project is, and why it's important to us.
## What is a minimal repro project?
A repro (or a reproduction) is a project, which can be used to reproduce the reported behavior with minimal effort from a product team, which has the minimum code required to demonstrate the concerning behavior.
There are two ways you can provide a minimal repro project. The first and simpler option is to use some type of public web-hosted REPL-based environment which supports ASP.NET Core. The other option is to provide a project hosted in GitHub as described below:
- Create a new project, based on one of the Blazor Server/WebAssembly project templates.
- **Please use the `Empty*` project templates** if they're available for that project type.
- Add the minimum amount of code necessary to reproduce the behavior you are reporting on this newly created project.
- Make sure you **do not** add any dependencies that are irrelevant to the behavior.
- Host the project as a **public** repository on GitHub.
- Make sure you haven't included any binaries in your project (this is usually about the `bin` and `obj` folders in your project)
Note: that this step is important and we won't be able to open zip attachments in your issues.
Zip files are potential attack vectors that we try to avoid at all cost.
## Important considerations
- **Never** include any sensitive information in your reproduction project.
- **Never** include any code that is not intended to be public in a repro.
- **Do not** reference any external services or data sources.