Skip to content

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

Merged
merged 20 commits into from
Jun 13, 2023
Merged

Add GitHub labels #15

merged 20 commits into from
Jun 13, 2023

Conversation

paulacamargo25
Copy link
Contributor

Closed: #12

@paulacamargo25 paulacamargo25 self-assigned this Jun 7, 2023
@paulacamargo25 paulacamargo25 added the debt Covers everything internal: CI, testing, refactoring of the codebase, etc. label Jun 7, 2023
@github-advanced-security
Copy link

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:
Copy link
Member

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.

@paulacamargo25 paulacamargo25 merged commit 02be02b into main Jun 13, 2023
@paulacamargo25 paulacamargo25 deleted the Add-github-labels branch June 13, 2023 01:04
Copy link
Contributor

@karrtikr karrtikr left a 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.

Comment on lines +1 to +39
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.')
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add triage-needed label to new issues
3 participants