-
Notifications
You must be signed in to change notification settings - Fork 49
Add GitHub labels #15
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
Conversation
11a9d45
to
ec3e6c8
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
@@ -47,6 +38,32 @@ def _update_pip_packages(session: nox.Session) -> None: | |||
) | |||
|
|||
|
|||
@nox.session() | |||
def lint(session: nox.Session) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future, this can be used for linting the entire extension.
fdb9da4
to
9594268
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is still using an older way to use Github actions, please look at the Python extension and update the code accordingly.
name: Issue labels | ||
|
||
on: | ||
issues: | ||
types: [opened, reopened] | ||
|
||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
# From https://github.com/marketplace/actions/github-script#apply-a-label-to-an-issue. | ||
add-triage-label: | ||
name: "Add 'triage-needed'" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const result = await github.rest.issues.listLabelsOnIssue({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
}) | ||
const labels = result.data.map((label) => label.name) | ||
const hasNeeds = labels.some((label) => label.startsWith('needs')) | ||
|
||
if (!hasNeeds) { | ||
console.log('This issue is not labeled with a "needs __" label, add the "triage-needed" label.') | ||
|
||
github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
labels: ['triage-needed'] | ||
}) | ||
} else { | ||
console.log('This issue already has a "needs __" label, do not add the "triage-needed" label.') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using microsoft/vscode-github-triage-actions
Closed: #12