This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'HumanSignal:master' into yolo-predictions
- Loading branch information
Showing
22 changed files
with
675 additions
and
171 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
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,103 @@ | ||
name: "/jira command" | ||
|
||
on: | ||
repository_dispatch: | ||
types: [ jira-command ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.client_payload.github.payload.issue.number }}-${{ github.event.client_payload.slash_command.command }}-${{ github.event.client_payload.slash_command.args.unnamed.arg1 || github.event.client_payload.slash_command.args.all }} | ||
|
||
jobs: | ||
create: | ||
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'create' }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Add Workflow link to command comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
- name: Check user's membership | ||
uses: actions/github-script@v7 | ||
id: check-membership | ||
env: | ||
ACTOR: ${{ github.actor }} | ||
with: | ||
github-token: ${{ secrets.GIT_PAT }} | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const actor = process.env.ACTOR; | ||
const { data: membership } = await github.rest.orgs.getMembershipForUser({ | ||
org: owner, | ||
username: actor, | ||
}); | ||
if (membership.state != "active") { | ||
const error = `Unfortunately you don't have membership in ${owner} organization, Jira Issue was not created`; | ||
core.setOutput("error", error); | ||
core.setFailed(error); | ||
} | ||
- name: Checkout Actions Hub | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: HumanSignal/actions-hub | ||
path: ./.github/actions-hub | ||
|
||
- name: Jira Create Issue | ||
id: jira-create-issue | ||
uses: ./.github/actions-hub/actions/jira-create-issue | ||
with: | ||
jira_server: ${{ vars.JIRA_SERVER }} | ||
jira_username: ${{ secrets.JIRA_USERNAME }} | ||
jira_token: ${{ secrets.JIRA_TOKEN }} | ||
summary: ${{ github.event.client_payload.github.payload.issue.title }} | ||
description: ${{ github.event.client_payload.github.payload.issue.body }} | ||
project: ${{ github.event.client_payload.slash_command.args.unnamed.arg3 || 'TRIAG' }} | ||
type: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 || 'task' }} | ||
|
||
- name: Add reaction to command comment on success | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Jira issue [${{ steps.jira-create-issue.outputs.key }}](${{ steps.jira-create-issue.outputs.link }}) is created | ||
reactions: "+1" | ||
|
||
- name: Add reaction to command comment on failure | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: failure() | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: failed to execute "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command | ||
> ${{ steps.check-membership.outputs.error }} | ||
reactions: "-1" | ||
|
||
help: | ||
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'help' || !contains(fromJson('["create"]'), github.event.client_payload.slash_command.args.unnamed.arg1) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Update comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Command | Description | ||
> --- | --- | ||
> /jira create [task|bug|story] `PROJECT` | Create a Jira issue in project `PROJECT` | ||
reaction-type: hooray |
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 |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
pull-requests: write | ||
steps: | ||
|
||
- uses: hmarr/debug-action@v2.1.0 | ||
- uses: hmarr/debug-action@v3.0.0 | ||
|
||
- name: "Validate PR's title" | ||
uses: thehanimo/[email protected] | ||
|
@@ -36,7 +36,7 @@ jobs: | |
configuration_path: ".github/pr-title-checker-config.json" | ||
|
||
- name: "Set PR's label based on title" | ||
uses: release-drafter/release-drafter@v5.25.0 | ||
uses: release-drafter/release-drafter@v6.0.0 | ||
with: | ||
disable-releaser: true | ||
config-name: autolabeler.yml | ||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Slash Command Dispatch | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
env: | ||
commands_list: | | ||
jira | ||
issue_commands_list: | | ||
jira | ||
jobs: | ||
slashCommandDispatch: | ||
if: startsWith(github.event.comment.body, '/') | ||
timeout-minutes: 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/[email protected] | ||
|
||
- name: 'Validate command' | ||
id: determine_command | ||
uses: actions/github-script@v7 | ||
env: | ||
COMMANDS_LIST: ${{ env.commands_list }} | ||
ISSUE_COMMANDS_LIST: ${{ env.issue_commands_list }} | ||
with: | ||
github-token: ${{ secrets.GIT_PAT }} | ||
script: | | ||
const body = context.payload.comment.body.toLowerCase().trim() | ||
const commands_list = process.env.COMMANDS_LIST.split("\n") | ||
const issue_commands_list = process.env.ISSUE_COMMANDS_LIST.split("\n") | ||
console.log("Detected PR comment: " + body) | ||
console.log("Commands list: " + commands_list) | ||
console.log("Issue commands list: " + issue_commands_list) | ||
commandArray = body.split(/\s+/) | ||
const contextCommand = commandArray[0].split('/')[1].trim(); | ||
console.log("contextCommand: " + contextCommand) | ||
core.setOutput('command_state', 'known') | ||
core.setOutput('is_issue_command', 'false') | ||
if (! commands_list.includes(contextCommand)) { | ||
core.setOutput('command_state', 'unknown') | ||
core.setOutput('command', contextCommand) | ||
} | ||
if (issue_commands_list.includes(contextCommand)) { | ||
core.setOutput('is_issue_command', 'true') | ||
} | ||
- name: Slash Command Dispatch for Issues | ||
id: scd_issues | ||
if: ${{ steps.determine_command.outputs.command_state != 'unknown' && steps.determine_command.outputs.is_issue_command == 'true' }} | ||
uses: peter-evans/slash-command-dispatch@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
reaction-token: ${{ secrets.GIT_PAT }} | ||
issue-type: "issue" | ||
reactions: true | ||
commands: ${{ env.issue_commands_list }} | ||
|
||
- name: Slash Command Dispatch for PRs | ||
id: scd_prs | ||
if: ${{ steps.determine_command.outputs.command_state != 'unknown' && steps.determine_command.outputs.is_issue_command != 'true' }} | ||
uses: peter-evans/slash-command-dispatch@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
reaction-token: ${{ secrets.GIT_PAT }} | ||
issue-type: "pull-request" | ||
reactions: true | ||
commands: ${{ env.commands_list }} | ||
|
||
- name: Edit comment with error message | ||
if: ${{ steps.determine_command.outputs.command_state == 'unknown' }} | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
body: | | ||
> '/${{ steps.determine_command.outputs.command }}' is an unknown command. | ||
> See '/help' | ||
reactions: eyes, confused |
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 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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
except ModuleNotFoundError as e: | ||
print(e) | ||
|
||
__version__ = '0.0.58.dev' | ||
__version__ = '0.0.59.dev' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""All tests for label-studio-converter should be written using pytest""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.