-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge https://github.com/pytorch/pytorch into flatten
- Loading branch information
Showing
4 changed files
with
80 additions
and
73 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: quantization-triage | ||
|
||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
jobs: | ||
welcome: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v2 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
// Arguments available: | ||
// - github: A pre-authenticated octokit/rest.js client | ||
// - context: An object containing the context of the workflow run | ||
// - core: A reference to the @actions/core package | ||
// - io: A reference to the @actions/io package | ||
// Check if issue has a Quantization label. | ||
const kQuantizationLabel = "oncall: quantization"; | ||
issue = await github.issues.get({ | ||
owner: context.issue.owner, | ||
repo: context.issue.repo, | ||
issue_number: context.issue.number, | ||
}) | ||
const hasQuantizationLabel = issue.data.labels.filter(label => label.name == kQuantizationLabel).length > 0; | ||
if (!hasQuantizationLabel) { | ||
core.debug("Issue " + issue.data.title + " does not have Quantization label"); | ||
return; | ||
} | ||
// Get project column ID. | ||
const kProjectName = "Quantization Triage"; | ||
const kColumnName = "Need Triage"; | ||
// Query all projects in the repository. | ||
// TODO: Support pagination once there are > 30 projects. | ||
const projects = await github.projects.listForRepo({ | ||
owner: context.issue.owner, | ||
repo: context.issue.repo, | ||
}); | ||
// Filter out unwanted projects and get the ID for the Quantization Triage project. | ||
const filteredProjects = projects.data.filter(project => project.name == kProjectName); | ||
if (filteredProjects.length != 1) { | ||
core.setFailed("Unable to find a project named " + kProjectName); | ||
return; | ||
} | ||
const projectId = filteredProjects[0].id; | ||
// First, query all columns in the project. | ||
// TODO: Support pagination once there are > 30 columns. | ||
const columns = await github.projects.listColumns({ | ||
project_id: projectId, | ||
}); | ||
// Filter out unwanted projects and get the ID for the Need triage column. | ||
const filteredColumns = columns.data.filter(column => column.name == kColumnName); | ||
if (filteredColumns.length != 1) { | ||
core.setFailed("Unable to find a column named " + kColumnName); | ||
return; | ||
} | ||
const columnId = filteredColumns[0].id; | ||
// Create a project card for this new issue. | ||
await github.projects.createCard({ | ||
column_id: columnId, | ||
content_id: issue.data.id, | ||
content_type: "Issue", | ||
}) |
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
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
This file was deleted.
Oops, something went wrong.