Skip to content

Commit a66a5c1

Browse files
committed
fix requirements for gliner
2 parents 1252b45 + f1d5877 commit a66a5c1

File tree

69 files changed

+5350
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5350
-59
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
if: needs.calculate_matrix.outputs.matrix-include != '[]'
2222
needs: calculate_matrix
2323
runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }}
24-
timeout-minutes: 30
24+
timeout-minutes: 45
2525
strategy:
2626
fail-fast: false
2727
matrix:
@@ -82,11 +82,11 @@ jobs:
8282
echo "image_branch_version=$image_branch_version" >> $GITHUB_OUTPUT
8383
8484
- name: Set up Docker Buildx
85-
uses: docker/setup-buildx-action@v3.9.0
85+
uses: docker/setup-buildx-action@v3.11.1
8686

8787
- name: Login to DockerHub
8888
if: ${{ !github.event.pull_request.head.repo.fork }}
89-
uses: docker/login-action@v3.3.0
89+
uses: docker/login-action@v3.4.0
9090
with:
9191
username: ${{ vars.DOCKERHUB_USERNAME }}
9292
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -111,8 +111,12 @@ jobs:
111111
core.setOutput("tags", tags);
112112
113113
- name: Push Docker image
114-
uses: docker/build-push-action@v6.13.0
114+
uses: docker/build-push-action@v6.18.0
115115
id: docker_build_and_push
116+
env:
117+
DOCKER_BUILD_CHECKS_ANNOTATIONS: "false"
118+
DOCKER_BUILD_SUMMARY: "false"
119+
DOCKER_BUILD_RECORD_UPLOAD: "false"
116120
with:
117121
context: "${{ env.DOCKER_EXAMPLES_DIRECTORY }}/${{ env.backend_dir_name }}"
118122
push: ${{ steps.actor-membership.outputs.active }}

.github/workflows/git-command.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: "/git command"
2+
3+
on:
4+
repository_dispatch:
5+
types: [ git-command ]
6+
7+
concurrency:
8+
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 }}
9+
10+
jobs:
11+
merge:
12+
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'merge' }}
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- uses: hmarr/[email protected]
17+
18+
- name: Add Workflow link to command comment
19+
uses: peter-evans/create-or-update-comment@v4
20+
with:
21+
token: ${{ secrets.GIT_PAT }}
22+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
23+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
24+
body: |
25+
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
26+
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
token: ${{ secrets.GIT_PAT }}
31+
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
32+
ref: ${{ github.event.client_payload.pull_request.head.ref }}
33+
34+
- name: Checkout Actions Hub
35+
uses: actions/checkout@v4
36+
with:
37+
token: ${{ secrets.GIT_PAT }}
38+
repository: HumanSignal/actions-hub
39+
path: ./.github/actions-hub
40+
41+
- name: Git Configure
42+
uses: ./.github/actions-hub/actions/git-configure
43+
with:
44+
username: ${{ github.event.client_payload.github.actor }}
45+
46+
- name: Git Merge
47+
id: merge
48+
uses: ./.github/actions-hub/actions/git-merge
49+
with:
50+
base_branch: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 || github.event.client_payload.pull_request.base.ref }}
51+
our_files: ""
52+
53+
- name: Git Push
54+
if: steps.merge.outputs.result == 'true'
55+
uses: ./.github/actions-hub/actions/git-push
56+
57+
- name: Add reaction to command comment
58+
uses: peter-evans/create-or-update-comment@v4
59+
if: always()
60+
with:
61+
token: ${{ secrets.GIT_PAT }}
62+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
63+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
64+
body: |
65+
> ${{ steps.merge.outputs.message || '**Error**: Workflow failed' }}
66+
reactions: ${{ steps.merge.outputs.reaction || '-1' }}
67+
68+
help:
69+
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'help' || !contains(fromJson('["merge"]'), github.event.client_payload.slash_command.args.unnamed.arg1) }}
70+
runs-on: ubuntu-latest
71+
timeout-minutes: 1
72+
steps:
73+
- name: Update comment
74+
uses: peter-evans/create-or-update-comment@v4
75+
with:
76+
token: ${{ secrets.GIT_PAT }}
77+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
78+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
79+
body: |
80+
> Command | Description
81+
> --- | ---
82+
> /git merge `branch` | Merge branch `branch` into current branch
83+
reactions: hooray

.github/workflows/gitleaks.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55

66
env:
7-
GIT_GITLEAKS_VERSION: 8.18.4
87
ACTIONS_STEP_DEBUG: '${{ secrets.ACTIONS_STEP_DEBUG }}'
98

109
jobs:
@@ -14,19 +13,32 @@ jobs:
1413
steps:
1514
- uses: hmarr/[email protected]
1615

17-
- name: Configure gitleaks binary cache
18-
id: cache
16+
- name: Install
17+
shell: bash
18+
run: |
19+
set -euo pipefail
20+
arch="$(uname)_$(uname -m)"
21+
platform=$(echo $arch | tr '[:upper:]' '[:lower:]' )
22+
echo "PLATFORM=$platform" >> $GITHUB_ENV
23+
echo "GITLEAKS_VERSION=$(curl -s https://api.github.com/repos/gitleaks/gitleaks/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')" >> $GITHUB_ENV
24+
25+
- name: Cache gitleaks archive
26+
id: cache_gitleaks
1927
uses: actions/cache@v4
2028
with:
2129
path: /usr/local/bin/gitleaks
22-
key: gitleaks-${{ env.GIT_GITLEAKS_VERSION }}
30+
key: gitleaks-${{ env.PLATFORM }}-${{ env.GITLEAKS_VERSION }}
2331

24-
- name: Install tools
25-
if: steps.cache.outputs.cache-hit != 'true'
32+
- name: Download and configure gitleaks
33+
shell: bash
2634
run: |
27-
wget -O - \
28-
"https://github.com/zricethezav/gitleaks/releases/download/v${{ env.GIT_GITLEAKS_VERSION }}/gitleaks_${{ env.GIT_GITLEAKS_VERSION }}_linux_x64.tar.gz" \
29-
| sudo tar xzf - -C /usr/local/bin
35+
set -euo pipefail
36+
if [[ "${{ steps.cache_gitleaks.outputs.cache-hit }}" != "true" ]]; then
37+
DOWNLOAD_URL="https://github.com/gitleaks/gitleaks/releases/download/v${{ env.GITLEAKS_VERSION }}/gitleaks_${{ env.GITLEAKS_VERSION }}_linux_x64.tar.gz"
38+
echo "Download Gitleaks ${{ env.GITLEAKS_VERSION }} for ${{ env.PLATFORM }} from ${DOWNLOAD_URL}"
39+
curl -fsSL "$DOWNLOAD_URL" | tar xzf - -C /usr/local/bin
40+
fi
41+
chmod +x /usr/local/bin/gitleaks
3042
3143
- name: Checkout
3244
uses: actions/checkout@v4
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Slash Command Dispatch
2+
on:
3+
issue_comment:
4+
types: [created]
5+
6+
env:
7+
pull_request_commands_list: |
8+
git
9+
10+
jobs:
11+
slashCommandDispatch:
12+
if: startsWith(github.event.comment.body, '/')
13+
timeout-minutes: 1
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: hmarr/[email protected]
17+
18+
- name: "React to comment"
19+
uses: peter-evans/create-or-update-comment@v4
20+
with:
21+
token: ${{ secrets.GIT_PAT }}
22+
comment-id: ${{ github.event.comment.id }}
23+
reactions: eyes
24+
25+
- name: "Validate command"
26+
id: determine_command
27+
uses: actions/github-script@v7
28+
env:
29+
COMMANDS_LIST: ${{ github.event.issue.pull_request && env.pull_request_commands_list }}
30+
with:
31+
github-token: ${{ secrets.GIT_PAT }}
32+
script: |
33+
const body = context.payload.comment.body.toLowerCase().trim();
34+
const commands_list = process.env.COMMANDS_LIST.split("\n");
35+
console.log(commands_list);
36+
const command = body.replace(/^\/+/, '').split(/\s+/)[0];
37+
core.setOutput('command', command);
38+
core.setOutput('command-state', commands_list.includes(command) ? 'known' : 'unknown');
39+
40+
- name: "Slash Command Dispatch"
41+
id: scd_issues
42+
if: steps.determine_command.outputs.command-state == 'known'
43+
uses: peter-evans/slash-command-dispatch@v4
44+
with:
45+
token: ${{ secrets.GIT_PAT }}
46+
reaction-token: ${{ secrets.GIT_PAT }}
47+
issue-type: ${{ github.event.issue.pull_request && 'pull-request' || 'issue' }}
48+
reactions: true
49+
commands: ${{ github.event.issue.pull_request && env.pull_request_commands_list }}
50+
51+
- name: "Edit comment with error message"
52+
if: steps.determine_command.outputs.command-state != 'known'
53+
uses: peter-evans/create-or-update-comment@v4
54+
with:
55+
token: ${{ secrets.GIT_PAT }}
56+
comment-id: ${{ github.event.comment.id }}
57+
body: |
58+
> '/${{ steps.determine_command.outputs.command }}' is an unknown ${{ github.event.issue.pull_request && 'pull-request' || 'issue' }} command.
59+
> See '/help'
60+
reactions: confused

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129

130130
- name: "Upload general coverage to Codecov"
131131
if: ${{ matrix.backend_dir_name == 'the_simplest_backend' }}
132-
uses: codecov/codecov-action@v5.3.1
132+
uses: codecov/codecov-action@v5.4.3
133133
with:
134134
name: codecov-general
135135
files: ./tests/${{ matrix.backend_dir_name }}_coverage.xml
@@ -138,7 +138,7 @@ jobs:
138138

139139
- name: "Upload ml-backend ${{ matrix.backend_dir_name }} coverage to Codecov"
140140
if: ${{ matrix.backend_dir_name == 'the_simplest_backend' }}
141-
uses: codecov/codecov-action@v5.3.1
141+
uses: codecov/codecov-action@v5.4.3
142142
with:
143143
name: codecov-${{ matrix.backend_dir_name }}
144144
files: ./label_studio_ml/examples/${{ matrix.backend_dir_name }}/coverage.xml
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "ZenDesk: Push an issue comment to zendesk ticket"
2+
3+
on:
4+
issue_comment:
5+
types:
6+
- created
7+
8+
jobs:
9+
issue_commented:
10+
name: Issue comment
11+
if: ${{ !github.event.issue.pull_request && github.event.comment.user.login != 'heidi-humansignal' }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: hmarr/[email protected]
15+
16+
- env:
17+
ZENDESK_HOST: ${{ vars.ZENDESK_HOST }}
18+
ZENDESK_USER: ${{ vars.ZENDESK_USER }}
19+
ZENDESK_TOKEN: ${{ secrets.ZENDESK_TOKEN }}
20+
ISSUE_URL: ${{ github.event.issue.html_url }}
21+
ISSUE_COMMENT_BODY: ${{ github.event.comment.body }}
22+
ISSUE_USER: ${{ github.event.comment.user.login }}
23+
WORKFLOW_RUN_LINK: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
24+
run: |
25+
echo "Looking up ticket by issue: ${ISSUE_URL}"
26+
tickets=$(curl "https://${ZENDESK_HOST}/api/v2/search.json?query=external_id:${ISSUE_URL}" \
27+
--user "${ZENDESK_USER}/token:${ZENDESK_TOKEN}" \
28+
-H "Content-Type: application/json")
29+
ticket_id=$(echo $tickets | jq '.results[0].id')
30+
echo "Found Zendesk ticket ${ticket_id}"
31+
32+
echo "Looking up user by issuer: ${ISSUE_USER}"
33+
users=$(curl "https://labelstudio.zendesk.com/api/v2/users/[email protected]" \
34+
--user "${ZENDESK_USER}/token:${ZENDESK_TOKEN}" \
35+
--header "Content-Type: application/json")
36+
user_id=$(echo $users | jq '.users[0].id')
37+
if [[ "$user_id" == "null" ]]; then
38+
echo "Fall back to generic github user"
39+
user_id="388861316959"
40+
else
41+
echo "Found user ${user_id}"
42+
fi
43+
44+
body=$(jq -n --arg body "$ISSUE_COMMENT_BODY" '{body: $body}' | jq .body)
45+
echo "$body"
46+
47+
curl "https://${ZENDESK_HOST}/api/v2/tickets/${ticket_id}.json" \
48+
--request PUT \
49+
--user "${ZENDESK_USER}/token:${ZENDESK_TOKEN}" \
50+
--header "Content-Type: application/json" \
51+
--data-binary @- <<DATA
52+
{
53+
"ticket": {
54+
"comment": {
55+
"body": "[GITHUB_ISSUE_COMMENT]\n\n${body:1:-1}\n\nGITHUB ISSUE URL: ${ISSUE_URL}\nWORKFLOW RUN: ${WORKFLOW_RUN_LINK}",
56+
"author_id": $user_id
57+
}
58+
}
59+
}
60+
DATA
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "ZenDesk: Create a zendesk ticket out of an issue"
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
issue_created:
10+
name: Issue created
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: hmarr/[email protected]
14+
15+
- env:
16+
ZENDESK_HOST: ${{ vars.ZENDESK_HOST }}
17+
ZENDESK_USER: ${{ vars.ZENDESK_USER }}
18+
ZENDESK_TOKEN: ${{ secrets.ZENDESK_TOKEN }}
19+
ISSUE_TITLE: ${{ github.event.issue.title }}
20+
ISSUE_BODY: ${{ github.event.issue.body }}
21+
ISSUE_USER: ${{ github.event.issue.user.login }}
22+
ISSUE_URL: ${{ github.event.issue.html_url }}
23+
WORKFLOW_RUN_LINK: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
24+
REPO_NAME: ${{ github.event.repository.name }}
25+
run: |
26+
body=$(jq -n --arg body "$ISSUE_BODY" '{body: $body}' | jq .body)
27+
echo "$body"
28+
29+
curl https://${ZENDESK_HOST}/api/v2/tickets \
30+
--request POST \
31+
--user "${ZENDESK_USER}/token:${ZENDESK_TOKEN}" \
32+
--header "Content-Type: application/json" \
33+
--data-binary @- <<DATA
34+
{
35+
"ticket": {
36+
"subject": "Github_Issue - ${REPO_NAME}: ${ISSUE_TITLE:0:35}",
37+
"comment": {
38+
"body": "[GITHUB_ISSUE_DESCRIPTION]\n\n${body:1:-1}\n\nGITHUB ISSUE URL: ${ISSUE_URL}\nWORKFLOW RUN: ${WORKFLOW_RUN_LINK}"
39+
},
40+
"tags": ["gh-issue"],
41+
"external_id": "$ISSUE_URL",
42+
"requester": {
43+
"locale_id": 1,
44+
"name": "$ISSUE_USER from Github",
45+
"email": "[email protected]"
46+
}
47+
}
48+
}
49+
DATA

0 commit comments

Comments
 (0)