From 5e968d0e835cab85210b9a2509498dd539c926cc Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 16:14:31 +0530 Subject: [PATCH 01/25] chore: add integration tests --- .github/workflows/trigger-tests.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/trigger-tests.yml diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml new file mode 100644 index 0000000..df529f3 --- /dev/null +++ b/.github/workflows/trigger-tests.yml @@ -0,0 +1,28 @@ +name: Trigger Tests in nvim-java/tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + trigger-tests: + runs-on: ubuntu-latest + + steps: + - name: Trigger workflow in nvim-java/tests + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.repos.createDispatchEvent({ + owner: 'nvim-java', + repo: 'tests', + event_type: 'test-nvim-java', + client_payload: { + triggered_by: context.repo.repo, + ref: context.sha, + event_type: context.eventName + } + }); \ No newline at end of file From 9515761ffca9c38593ee4c1349fef669f6892b72 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 16:37:42 +0530 Subject: [PATCH 02/25] chore: change token --- .github/workflows/trigger-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index df529f3..75cbf24 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -14,7 +14,7 @@ jobs: - name: Trigger workflow in nvim-java/tests uses: actions/github-script@v7 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.INTEGRATION_TEST_TOKEN }} script: | github.rest.repos.createDispatchEvent({ owner: 'nvim-java', @@ -25,4 +25,4 @@ jobs: ref: context.sha, event_type: context.eventName } - }); \ No newline at end of file + }); From fa63ea237e0ffa7757ea86136360b94aedce52a0 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:31:35 +0530 Subject: [PATCH 03/25] chor --- .github/workflows/trigger-tests.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 75cbf24..c4e0a03 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] + workflow_call: jobs: trigger-tests: @@ -12,17 +12,4 @@ jobs: steps: - name: Trigger workflow in nvim-java/tests - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.INTEGRATION_TEST_TOKEN }} - script: | - github.rest.repos.createDispatchEvent({ - owner: 'nvim-java', - repo: 'tests', - event_type: 'test-nvim-java', - client_payload: { - triggered_by: context.repo.repo, - ref: context.sha, - event_type: context.eventName - } - }); + uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main From 44fad0df98f3cbbc4f3a008aa48310172ecd7027 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:33:29 +0530 Subject: [PATCH 04/25] chore --- .github/workflows/trigger-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index c4e0a03..7ad1fa0 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -1,8 +1,6 @@ name: Trigger Tests in nvim-java/tests on: - push: - branches: [ main ] pull_request: workflow_call: From 9b774af2a0a08d57a9c9567fe13e63eb7da052fd Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:35:11 +0530 Subject: [PATCH 05/25] hore --- .github/workflows/trigger-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 7ad1fa0..3d93cff 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -1,13 +1,16 @@ name: Trigger Tests in nvim-java/tests on: + push: + branches: [ main ] pull_request: + workflow_dispatch: workflow_call: jobs: trigger-tests: runs-on: ubuntu-latest - steps: + - name: Trigger workflow in nvim-java/tests uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main From db1ca99a665c719352ae67f048781243d1642faa Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:43:28 +0530 Subject: [PATCH 06/25] chore --- .github/workflows/trigger-tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 3d93cff..9a648ac 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -8,9 +8,7 @@ on: workflow_call: jobs: - trigger-tests: + trigger-integration-tests: runs-on: ubuntu-latest - steps: - - - name: Trigger workflow in nvim-java/tests - uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main + name: Trigger workflow in nvim-java/tests + uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main From 250300d25a064482ac3bf76f8bcb675e07b095c8 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:48:12 +0530 Subject: [PATCH 07/25] chore --- .github/workflows/trigger-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 9a648ac..d75b819 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -9,6 +9,4 @@ on: jobs: trigger-integration-tests: - runs-on: ubuntu-latest - name: Trigger workflow in nvim-java/tests uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main From a37f8f954a50e1bbd0bc37254d1d7ecca4175de9 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:52:33 +0530 Subject: [PATCH 08/25] choreeeee --- .github/workflows/trigger-tests.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index d75b819..4d2997c 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -4,9 +4,25 @@ on: push: branches: [ main ] pull_request: - workflow_dispatch: - workflow_call: + branches: [ main ] jobs: - trigger-integration-tests: - uses: nvim-java/tests/.github/workflows/test-nvim-java.yml@main + trigger-tests: + runs-on: ubuntu-latest + + steps: + - name: Trigger workflow in nvim-java/tests + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.repos.createDispatchEvent({ + owner: 'nvim-java', + repo: 'tests', + event_type: 'test-nvim-java', + client_payload: { + triggered_by: context.repo.repo, + ref: context.sha, + event_type: context.eventName + } + }); From c7fa455581fb90db8a8cb17d48b6f2c96f5bdeee Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Thu, 7 Aug 2025 17:53:38 +0530 Subject: [PATCH 09/25] chore --- .github/workflows/trigger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 4d2997c..75cbf24 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -14,7 +14,7 @@ jobs: - name: Trigger workflow in nvim-java/tests uses: actions/github-script@v7 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.INTEGRATION_TEST_TOKEN }} script: | github.rest.repos.createDispatchEvent({ owner: 'nvim-java', From bb8d2c9abdf034e5b24384feaae884fe062bd3d7 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 11:53:19 +0530 Subject: [PATCH 10/25] chore --- .github/workflows/trigger-tests.yml | 112 ++++++++++++++++++++++++---- 1 file changed, 98 insertions(+), 14 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 75cbf24..7747daf 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -12,17 +12,101 @@ jobs: steps: - name: Trigger workflow in nvim-java/tests - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.INTEGRATION_TEST_TOKEN }} - script: | - github.rest.repos.createDispatchEvent({ - owner: 'nvim-java', - repo: 'tests', - event_type: 'test-nvim-java', - client_payload: { - triggered_by: context.repo.repo, - ref: context.sha, - event_type: context.eventName - } - }); + runs: | + OWNER="nvim-java" + REPO="tests" + + # Get workflows and extract URL and ID for "Test nvim-java Plugin" + response=$(curl -s -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") + + # Extract URL and ID using jq + workflow_url=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .url') + workflow_id=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .id') + + echo "Workflow URL: $workflow_url" + echo "Workflow ID: $workflow_id" + + # Trigger workflow dispatch + if [ ! -z "$workflow_id" ]; then + dispatch_response=$(curl -s -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ + -d '{"ref":"main"}') + + echo "Workflow dispatch triggered" + if [ ! -z "$dispatch_response" ]; then + echo "Response:" + echo "$dispatch_response" | jq '.' + else + echo "No response body (successful dispatch returns empty response)" + fi + + # Wait for the workflow run to start and get the run ID + echo "Waiting for workflow run to start..." + run_id="" + start_time=$(date +%s) + timeout=60 # 60 seconds timeout + + while [ -z "$run_id" ]; do + current_time=$(date +%s) + if [ $((current_time - start_time)) -gt $timeout ]; then + echo "Timeout waiting for workflow to start" + exit 1 + fi + + sleep 5 + runs_response=$(curl -s -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/runs?per_page=1") + + latest_run_id=$(echo "$runs_response" | jq -r '.workflow_runs[0].id') + latest_run_time=$(echo "$runs_response" | jq -r '.workflow_runs[0].created_at') + + # Check if this run was created after we triggered the workflow + if [ ! -z "$latest_run_id" ] && [ "$latest_run_id" != "null" ]; then + run_created=$(date -d "$latest_run_time" +%s 2>/dev/null || echo "0") + if [ $run_created -gt $((start_time - 10)) ]; then + run_id=$latest_run_id + echo "Found new workflow run: $run_id" + fi + fi + done + + # Wait for workflow to complete + echo "Waiting for workflow run $run_id to complete..." + while true; do + run_response=$(curl -s -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id") + + status=$(echo "$run_response" | jq -r '.status') + conclusion=$(echo "$run_response" | jq -r '.conclusion') + + echo "Workflow status: $status" + + if [ "$status" = "completed" ]; then + echo "Workflow completed with conclusion: $conclusion" + if [ "$conclusion" = "success" ]; then + echo "Workflow succeeded!" + exit 0 + else + echo "Workflow failed with conclusion: $conclusion" + exit 1 + fi + fi + + sleep 10 + done + fi + From 03752f0a7ddaaefc85434d4dd9748d12913083de Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:17:35 +0530 Subject: [PATCH 11/25] chore --- .github/workflows/trigger-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 7747daf..9a71e9c 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -4,7 +4,6 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] jobs: trigger-tests: From 74320a2683ae537f2a5ec1088ecd164c40537b2e Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:20:04 +0530 Subject: [PATCH 12/25] chore --- .github/workflows/trigger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 9a71e9c..194c971 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Trigger workflow in nvim-java/tests - runs: | + run: | OWNER="nvim-java" REPO="tests" From 9ad075b5f01edee756ecce5a843d5bfa9e4363d1 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:21:37 +0530 Subject: [PATCH 13/25] chore --- .github/workflows/trigger-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 194c971..2f5aef9 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -18,7 +18,7 @@ jobs: # Get workflows and extract URL and ID for "Test nvim-java Plugin" response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer ${TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") @@ -34,7 +34,7 @@ jobs: dispatch_response=$(curl -s -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer ${TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ -d '{"ref":"main"}') @@ -63,7 +63,7 @@ jobs: sleep 5 runs_response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer ${TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/runs?per_page=1") @@ -85,7 +85,7 @@ jobs: while true; do run_response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer ${TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id") From c972c96335ff962b471f802c9e65890e99cadee2 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:24:16 +0530 Subject: [PATCH 14/25] chore --- .github/workflows/trigger-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 2f5aef9..e1f3574 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -22,15 +22,20 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") + echo "11111111111" + # Extract URL and ID using jq workflow_url=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .url') + echo "22222222222" workflow_id=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .id') + echo "33333333333" echo "Workflow URL: $workflow_url" echo "Workflow ID: $workflow_id" # Trigger workflow dispatch if [ ! -z "$workflow_id" ]; then + echo "44444444444" dispatch_response=$(curl -s -L \ -X POST \ -H "Accept: application/vnd.github+json" \ @@ -39,6 +44,7 @@ jobs: "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ -d '{"ref":"main"}') + echo "55555555555" echo "Workflow dispatch triggered" if [ ! -z "$dispatch_response" ]; then echo "Response:" From 469d9ed094c15f5d7cba51abba49d39d716fc239 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:25:22 +0530 Subject: [PATCH 15/25] res --- .github/workflows/trigger-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index e1f3574..2bf5a1a 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -23,6 +23,7 @@ jobs: "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") echo "11111111111" + echo "$response" # Extract URL and ID using jq workflow_url=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .url') From 86f7699ba2feadfe05b37517e9ee929afdfc1e3c Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:28:31 +0530 Subject: [PATCH 16/25] chore --- .github/workflows/trigger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 2bf5a1a..941b995 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -18,7 +18,7 @@ jobs: # Get workflows and extract URL and ID for "Test nvim-java Plugin" response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${TOKEN}" \ + -H "Authorization: Bearer ${TEST_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") From 309659c35240d3aac173efbcbc38fe390d7a82c4 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:30:47 +0530 Subject: [PATCH 17/25] chore --- .github/workflows/trigger-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 941b995..b00a480 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -16,6 +16,7 @@ jobs: REPO="tests" # Get workflows and extract URL and ID for "Test nvim-java Plugin" + echo ${TEST_TOKEN} response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${TEST_TOKEN}" \ From 569c203138209eb5f91076bd91fc80ca75085fd6 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:31:41 +0530 Subject: [PATCH 18/25] chore --- .github/workflows/trigger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index b00a480..3f74390 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -16,7 +16,7 @@ jobs: REPO="tests" # Get workflows and extract URL and ID for "Test nvim-java Plugin" - echo ${TEST_TOKEN} + echo "** ${TEST_TOKEN}" response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${TEST_TOKEN}" \ From ebc8a9ebe0e45c67beec729f488c5b588491b955 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 12:34:14 +0530 Subject: [PATCH 19/25] chore --- .github/workflows/trigger-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 3f74390..322f00e 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -16,7 +16,9 @@ jobs: REPO="tests" # Get workflows and extract URL and ID for "Test nvim-java Plugin" + echo "** ${TEST_TOKEN}" + response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${TEST_TOKEN}" \ From a9a6fb509a0a6689207c5c5e3982470b36c12c74 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 13:18:17 +0530 Subject: [PATCH 20/25] chore --- .github/workflows/trigger-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 322f00e..3898190 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -11,17 +11,17 @@ jobs: steps: - name: Trigger workflow in nvim-java/tests + env: + TEST_TOKEN: ${{ secrets.TEST_TOKEN }} run: | OWNER="nvim-java" REPO="tests" # Get workflows and extract URL and ID for "Test nvim-java Plugin" - echo "** ${TEST_TOKEN}" - response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${TEST_TOKEN}" \ + -H "Authorization: Bearer $TEST_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") @@ -43,7 +43,7 @@ jobs: dispatch_response=$(curl -s -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${TOKEN}" \ + -H "Authorization: Bearer $TEST_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ -d '{"ref":"main"}') @@ -73,7 +73,7 @@ jobs: sleep 5 runs_response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${TOKEN}" \ + -H "Authorization: Bearer $TEST_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/runs?per_page=1") @@ -95,7 +95,7 @@ jobs: while true; do run_response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${TOKEN}" \ + -H "Authorization: Bearer $TEST_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id") From 7df6b53ad9c16e582233e8cdad7d53ce1e27e766 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 13:21:13 +0530 Subject: [PATCH 21/25] chore --- .github/workflows/trigger-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 3898190..aaf3d74 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -25,21 +25,17 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows") - echo "11111111111" echo "$response" # Extract URL and ID using jq workflow_url=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .url') - echo "22222222222" workflow_id=$(echo "$response" | jq -r '.workflows[] | select(.name == "Test nvim-java Plugin") | .id') - echo "33333333333" echo "Workflow URL: $workflow_url" echo "Workflow ID: $workflow_id" # Trigger workflow dispatch if [ ! -z "$workflow_id" ]; then - echo "44444444444" dispatch_response=$(curl -s -L \ -X POST \ -H "Accept: application/vnd.github+json" \ @@ -48,7 +44,6 @@ jobs: "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ -d '{"ref":"main"}') - echo "55555555555" echo "Workflow dispatch triggered" if [ ! -z "$dispatch_response" ]; then echo "Response:" From f01a9d6fd889b5293e246135d94f6f800f79740d Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 14:52:41 +0530 Subject: [PATCH 22/25] chore --- .github/workflows/trigger-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index aaf3d74..a2090f1 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -18,7 +18,6 @@ jobs: REPO="tests" # Get workflows and extract URL and ID for "Test nvim-java Plugin" - response=$(curl -s -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $TEST_TOKEN" \ From fa8d1e96876f180f58a4d429089a8258b155ebd9 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 14:53:22 +0530 Subject: [PATCH 23/25] chore From 843ea2ab68f565b4f885ffeebcdb5e141ffe2305 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 15:07:03 +0530 Subject: [PATCH 24/25] set current branch --- .github/workflows/trigger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index a2090f1..cd37bf3 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -41,7 +41,7 @@ jobs: -H "Authorization: Bearer $TEST_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$workflow_id/dispatches" \ - -d '{"ref":"main"}') + -d '{"ref":"main","inputs":{"nvim_java_branch":"${{ github.head_ref }}"}}') echo "Workflow dispatch triggered" if [ ! -z "$dispatch_response" ]; then From 0138baedd08727a923f7e9d8f6a5748caedef3cf Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Fri, 8 Aug 2025 15:15:21 +0530 Subject: [PATCH 25/25] chore