From f4c9d16907a66addc19a20f6769da53ce496c9ac Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 10:23:32 +0100 Subject: [PATCH 01/19] improve spec_diff step --- .github/workflows/spec-update.yaml | 36 +++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 052a3e1c3..43e87b6cb 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -140,13 +140,43 @@ jobs: gh api $API_URL -H "Accept: application/vnd.github.raw" > $FILE_PATH - - name: "Exit if there are no changes" + - name: "Exit if there are no spec changes" id: spec_diff run: | + # if there are no spec changes in this commit, check if previous run on this branch is red. If it is red, exit 1; if it is green, exit 0. if [[ `git status --porcelain` ]]; then + echo "Spec changes detected, continuing with generation." echo "spec_diff=true" >> "$GITHUB_OUTPUT" else + echo "No spec changes detected. Checking status of previous run." echo "spec_diff=false" >> "$GITHUB_OUTPUT" + + # The current run of this workflow + CURRENT_RUN=${{ github.run_id }} + + # Get the most recent completed run of this workflow on the current branch + PREVIOUS_RUN=$(gh run list \ + --workflow "${{ github.workflow }}" \ + --branch "${{ steps.branch.outputs.branch }}" \ + --limit 2 \ + --json databaseId,status,conclusion \ + --jq "map(select(.databaseId != ${CURRENT_RUN})) | .[0]") + + if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then + CONCLUSION=$(echo "$PREVIOUS_RUN" | jq -r '.conclusion') + echo "Previous run conclusion: $CONCLUSION" + + if [ "$CONCLUSION" = "failure" ]; then + echo "Previous run failed and there were no spec changes since, thus failing this run as well." + echo "prev_run_success=false" >> "$GITHUB_OUTPUT" + else + echo "Previous run succeeded and there were no spec changes since, thus the current run succeeds as well." + echo "prev_run_success=true" >> "$GITHUB_OUTPUT" + fi + else + echo "There was no previous run, thus the current run succeeds." + echo "prev_run_success=true" >> "$GITHUB_OUTPUT" + fi fi - name: "Generate" @@ -235,6 +265,10 @@ jobs: echo "| File Download | ${{ steps.download.outcome == 'success' && '✅' || '❌' }} ${{ steps.download.outcome }}" >> $GITHUB_STEP_SUMMARY echo "| Spec File Changes | ${{ steps.spec_diff.outputs.spec_diff == 'true' && '🔄 Changes Detected' || 'âšī¸ No Changes' }}" >> $GITHUB_STEP_SUMMARY + if ${{ steps.spec_diff.outputs.spec_diff == 'false' }}; then + echo "| Outcome Previous Run | ${{ steps.spec_diff.outputs.prev_run_success == 'true' && '✅: Current run succeeds as a result.' || '❌: Current run fails as a result.' }}" >> $GITHUB_STEP_SUMMARY + fi + if ${{ steps.spec_diff.outputs.spec_diff == 'true' }}; then echo "| Client Generation | ${{ steps.generate.outputs.generation_result == 'success' && '✅' || '❌' }} ${{ steps.generate.outputs.generation_result }}" >> $GITHUB_STEP_SUMMARY echo "| Client Compilation | ${{ steps.compile.outputs.compilation_result == 'success' && '✅' || '❌' }} ${{ steps.compile.outputs.compilation_result }}" >> $GITHUB_STEP_SUMMARY From 1e8a0a2893218963154cf245747844e2412aca66 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 10:43:01 +0100 Subject: [PATCH 02/19] fix --- .github/workflows/spec-update.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 43e87b6cb..0026b7075 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -142,6 +142,8 @@ jobs: - name: "Exit if there are no spec changes" id: spec_diff + env: + GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }} run: | # if there are no spec changes in this commit, check if previous run on this branch is red. If it is red, exit 1; if it is green, exit 0. if [[ `git status --porcelain` ]]; then From 6d2f90268f7e6f46819d9e3be0065cd4cfa3648b Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 12:36:46 +0100 Subject: [PATCH 03/19] improve workflow --- .github/workflows/spec-update.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 0026b7075..bbf713873 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -1,4 +1,4 @@ -name: "Spec File Update Workflow" +name: "Spec File Update Workflow: ${{ github.event.inputs.file }}-${{ github.event.inputs.file-ref }}" on: workflow_dispatch: @@ -155,14 +155,18 @@ jobs: # The current run of this workflow CURRENT_RUN=${{ github.run_id }} + + # name must match the workflow name pattern above + RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" # Get the most recent completed run of this workflow on the current branch PREVIOUS_RUN=$(gh run list \ --workflow "${{ github.workflow }}" \ - --branch "${{ steps.branch.outputs.branch }}" \ + --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion \ - --jq "map(select(.databaseId != ${CURRENT_RUN})) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.name | contains(\"${RUN_TOKEN}\")))) | .[0]") + # todo: change branch above to main if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then CONCLUSION=$(echo "$PREVIOUS_RUN" | jq -r '.conclusion') From d4ad551bd6a05d14fc80a476c11714c1b03c6853 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 12:53:59 +0100 Subject: [PATCH 04/19] improve workflow --- .github/workflows/spec-update.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index bbf713873..9f290d83c 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -1,4 +1,5 @@ -name: "Spec File Update Workflow: ${{ github.event.inputs.file }}-${{ github.event.inputs.file-ref }}" +name: "Spec File Update Workflow" +run-name: "Spec File Update Workflow: ${{ github.event.inputs.file }}-${{ github.event.inputs.file-ref }}" on: workflow_dispatch: @@ -156,7 +157,7 @@ jobs: # The current run of this workflow CURRENT_RUN=${{ github.run_id }} - # name must match the workflow name pattern above + # name must match the workflow run-name pattern above RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" # Get the most recent completed run of this workflow on the current branch @@ -164,8 +165,8 @@ jobs: --workflow "${{ github.workflow }}" \ --branch improve-spec-update-workflow \ --limit 2 \ - --json databaseId,status,conclusion \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.name | contains(\"${RUN_TOKEN}\")))) | .[0]") + --json databaseId,status,conclusion,display_name \ + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.display_name == \"${RUN_TOKEN}\"))) | .[0]") # todo: change branch above to main if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then From 3893dd978bc07ccaf415f4da0cc4892213ba48f0 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:03:35 +0100 Subject: [PATCH 05/19] improve workflow --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 9f290d83c..fca89b5ed 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -166,7 +166,7 @@ jobs: --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion,display_name \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.display_name == \"${RUN_TOKEN}\"))) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle == \"${RUN_TOKEN}\"))) | .[0]") # todo: change branch above to main if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then From a8865c99e1fdeacba0cd75eb38797ca54c1c44a9 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:09:39 +0100 Subject: [PATCH 06/19] improve workflow --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index fca89b5ed..2f6318df7 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -165,7 +165,7 @@ jobs: --workflow "${{ github.workflow }}" \ --branch improve-spec-update-workflow \ --limit 2 \ - --json databaseId,status,conclusion,display_name \ + --json databaseId,status,conclusion,displayTitle \ --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle == \"${RUN_TOKEN}\"))) | .[0]") # todo: change branch above to main From 53e9c2a229b910eaf67ee6fa17a08be1e205a1e6 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:16:14 +0100 Subject: [PATCH 07/19] improve workflow --- .github/workflows/spec-update.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 2f6318df7..3491bb915 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -159,6 +159,7 @@ jobs: # name must match the workflow run-name pattern above RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" + echo "Run name used for search: $RUN_NAME" # Get the most recent completed run of this workflow on the current branch PREVIOUS_RUN=$(gh run list \ @@ -166,8 +167,11 @@ jobs: --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion,displayTitle \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle == \"${RUN_TOKEN}\"))) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} )) | .[0]") # todo: change branch above to main + # and (.displayTitle == \"${RUN_TOKEN}\") + + echo "Previous run: $PREVIOUS_RUN" if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then CONCLUSION=$(echo "$PREVIOUS_RUN" | jq -r '.conclusion') From 91d4b50e04092e4fe428e52cd5a4a67d8dc8a776 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:20:42 +0100 Subject: [PATCH 08/19] improve workflow --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 3491bb915..2562dc486 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -167,7 +167,7 @@ jobs: --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion,displayTitle \ - --jq "map(select(.databaseId != ${CURRENT_RUN} )) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_TOKEN}\")) | .[0]") # todo: change branch above to main # and (.displayTitle == \"${RUN_TOKEN}\") From 9d29336672b6c791113ed52583ca713cdd0c6a16 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:23:59 +0100 Subject: [PATCH 09/19] improve workflow --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 2562dc486..d96af48a0 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -167,7 +167,7 @@ jobs: --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion,displayTitle \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_TOKEN}\")) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")) | .[0]") # todo: change branch above to main # and (.displayTitle == \"${RUN_TOKEN}\") From f3e1624aafce090dee1f2fe5acf2912055fabb17 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:30:48 +0100 Subject: [PATCH 10/19] improve workflow --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index d96af48a0..604c0cb69 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -167,7 +167,7 @@ jobs: --branch improve-spec-update-workflow \ --limit 2 \ --json databaseId,status,conclusion,displayTitle \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")) | .[0]") + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")))) | .[0]") # todo: change branch above to main # and (.displayTitle == \"${RUN_TOKEN}\") From 40afd04222c1ac041d249ea0c0242731d38ad95d Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 13:40:41 +0100 Subject: [PATCH 11/19] improve workflow --- .github/workflows/spec-update.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 604c0cb69..7c5c053f1 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -294,6 +294,12 @@ jobs: echo "Client generation failed. Please check the Generate step logs for details." exit 1 + - name: "Fail if no spec changes and previous run failed" + if: steps.spec_diff.outputs.prev_run_success == 'false' + run: | + echo "Previous run failed and there were no spec changes since, thus failing this run as well." + exit 1 + - name: "Slack Notification" if: failure() && github.event.inputs.create-pr == 'true' uses: slackapi/slack-github-action@v2.1.1 From 00f8f31bd8df30babedbc74baff160506f062e59 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 15:26:47 +0100 Subject: [PATCH 12/19] revert changes --- .github/workflows/spec-update.yaml | 55 ++---------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 7c5c053f1..a65e99f63 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -1,5 +1,4 @@ name: "Spec File Update Workflow" -run-name: "Spec File Update Workflow: ${{ github.event.inputs.file }}-${{ github.event.inputs.file-ref }}" on: workflow_dispatch: @@ -141,53 +140,15 @@ jobs: gh api $API_URL -H "Accept: application/vnd.github.raw" > $FILE_PATH - - name: "Exit if there are no spec changes" + - name: "Exit if there are no changes" id: spec_diff - env: - GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }} run: | - # if there are no spec changes in this commit, check if previous run on this branch is red. If it is red, exit 1; if it is green, exit 0. if [[ `git status --porcelain` ]]; then - echo "Spec changes detected, continuing with generation." echo "spec_diff=true" >> "$GITHUB_OUTPUT" + echo "Spec changes detected" else - echo "No spec changes detected. Checking status of previous run." echo "spec_diff=false" >> "$GITHUB_OUTPUT" - - # The current run of this workflow - CURRENT_RUN=${{ github.run_id }} - - # name must match the workflow run-name pattern above - RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" - echo "Run name used for search: $RUN_NAME" - - # Get the most recent completed run of this workflow on the current branch - PREVIOUS_RUN=$(gh run list \ - --workflow "${{ github.workflow }}" \ - --branch improve-spec-update-workflow \ - --limit 2 \ - --json databaseId,status,conclusion,displayTitle \ - --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")))) | .[0]") - # todo: change branch above to main - # and (.displayTitle == \"${RUN_TOKEN}\") - - echo "Previous run: $PREVIOUS_RUN" - - if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then - CONCLUSION=$(echo "$PREVIOUS_RUN" | jq -r '.conclusion') - echo "Previous run conclusion: $CONCLUSION" - - if [ "$CONCLUSION" = "failure" ]; then - echo "Previous run failed and there were no spec changes since, thus failing this run as well." - echo "prev_run_success=false" >> "$GITHUB_OUTPUT" - else - echo "Previous run succeeded and there were no spec changes since, thus the current run succeeds as well." - echo "prev_run_success=true" >> "$GITHUB_OUTPUT" - fi - else - echo "There was no previous run, thus the current run succeeds." - echo "prev_run_success=true" >> "$GITHUB_OUTPUT" - fi + echo "No spec changes detected" fi - name: "Generate" @@ -276,10 +237,6 @@ jobs: echo "| File Download | ${{ steps.download.outcome == 'success' && '✅' || '❌' }} ${{ steps.download.outcome }}" >> $GITHUB_STEP_SUMMARY echo "| Spec File Changes | ${{ steps.spec_diff.outputs.spec_diff == 'true' && '🔄 Changes Detected' || 'âšī¸ No Changes' }}" >> $GITHUB_STEP_SUMMARY - if ${{ steps.spec_diff.outputs.spec_diff == 'false' }}; then - echo "| Outcome Previous Run | ${{ steps.spec_diff.outputs.prev_run_success == 'true' && '✅: Current run succeeds as a result.' || '❌: Current run fails as a result.' }}" >> $GITHUB_STEP_SUMMARY - fi - if ${{ steps.spec_diff.outputs.spec_diff == 'true' }}; then echo "| Client Generation | ${{ steps.generate.outputs.generation_result == 'success' && '✅' || '❌' }} ${{ steps.generate.outputs.generation_result }}" >> $GITHUB_STEP_SUMMARY echo "| Client Compilation | ${{ steps.compile.outputs.compilation_result == 'success' && '✅' || '❌' }} ${{ steps.compile.outputs.compilation_result }}" >> $GITHUB_STEP_SUMMARY @@ -294,12 +251,6 @@ jobs: echo "Client generation failed. Please check the Generate step logs for details." exit 1 - - name: "Fail if no spec changes and previous run failed" - if: steps.spec_diff.outputs.prev_run_success == 'false' - run: | - echo "Previous run failed and there were no spec changes since, thus failing this run as well." - exit 1 - - name: "Slack Notification" if: failure() && github.event.inputs.create-pr == 'true' uses: slackapi/slack-github-action@v2.1.1 From 04bbe3a2114ab99b8eadf289c568fa84d429237a Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 15:41:11 +0100 Subject: [PATCH 13/19] print spec --- .github/workflows/spec-update.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index a65e99f63..ef5b0ef30 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -140,6 +140,12 @@ jobs: gh api $API_URL -H "Accept: application/vnd.github.raw" > $FILE_PATH + - name: Print spec contents for debugging + run: | + echo "=== Contents of $FILE_PATH ===" + cat -n "$FILE_PATH" + echo "=== End of file ===" + - name: "Exit if there are no changes" id: spec_diff run: | From a72101e88f4c077ea85fe12f016b036a709c42c5 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 15:55:11 +0100 Subject: [PATCH 14/19] print spec --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index ef5b0ef30..00f8b828c 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -143,7 +143,7 @@ jobs: - name: Print spec contents for debugging run: | echo "=== Contents of $FILE_PATH ===" - cat -n "$FILE_PATH" + cat -n "orchestration/src/main/resources/spec/orchestration.yaml" echo "=== End of file ===" - name: "Exit if there are no changes" From 47426dcd5fcf5f74c7c0e735e031070d97f4b5c4 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Thu, 5 Feb 2026 16:18:08 +0100 Subject: [PATCH 15/19] apply changes --- .github/workflows/spec-update.yaml | 57 +++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 00f8b828c..a1a4d4c3e 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -1,4 +1,5 @@ name: "Spec File Update Workflow" +run-name: "Spec File Update Workflow: ${{ github.event.inputs.file }}-${{ github.event.inputs.file-ref }}" on: workflow_dispatch: @@ -140,21 +141,59 @@ jobs: gh api $API_URL -H "Accept: application/vnd.github.raw" > $FILE_PATH - - name: Print spec contents for debugging + - name: "Print spec contents for debugging" run: | echo "=== Contents of $FILE_PATH ===" cat -n "orchestration/src/main/resources/spec/orchestration.yaml" echo "=== End of file ===" - - name: "Exit if there are no changes" + - name: "Exit if there are no spec changes" id: spec_diff + env: + GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }} run: | + # if there are no spec changes in this commit, check if previous run on this branch is red. If it is red, exit 1; if it is green, exit 0. if [[ `git status --porcelain` ]]; then + echo "Spec changes detected, continuing with generation." echo "spec_diff=true" >> "$GITHUB_OUTPUT" - echo "Spec changes detected" else + echo "No spec changes detected. Checking status of previous run." echo "spec_diff=false" >> "$GITHUB_OUTPUT" - echo "No spec changes detected" + + # The current run of this workflow + CURRENT_RUN=${{ github.run_id }} + + # name must match the workflow run-name pattern above + RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" + echo "Run name used for search: $RUN_NAME" + + # Get the most recent completed run of this workflow on the current branch + PREVIOUS_RUN=$(gh run list \ + --workflow "${{ github.workflow }}" \ + --branch improve-spec-update-workflow \ + --limit 2 \ + --json databaseId,status,conclusion,displayTitle \ + --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")))) | .[0]") + # todo: change branch above to main + # and (.displayTitle == \"${RUN_TOKEN}\") + + echo "Previous run: $PREVIOUS_RUN" + + if [ -n "$PREVIOUS_RUN" ] && [ "$PREVIOUS_RUN" != "null" ]; then + CONCLUSION=$(echo "$PREVIOUS_RUN" | jq -r '.conclusion') + echo "Previous run conclusion: $CONCLUSION" + + if [ "$CONCLUSION" = "failure" ]; then + echo "Previous run failed and there were no spec changes since, thus failing this run as well." + echo "prev_run_success=false" >> "$GITHUB_OUTPUT" + else + echo "Previous run succeeded and there were no spec changes since, thus the current run succeeds as well." + echo "prev_run_success=true" >> "$GITHUB_OUTPUT" + fi + else + echo "There was no previous run, thus the current run succeeds." + echo "prev_run_success=true" >> "$GITHUB_OUTPUT" + fi fi - name: "Generate" @@ -243,6 +282,10 @@ jobs: echo "| File Download | ${{ steps.download.outcome == 'success' && '✅' || '❌' }} ${{ steps.download.outcome }}" >> $GITHUB_STEP_SUMMARY echo "| Spec File Changes | ${{ steps.spec_diff.outputs.spec_diff == 'true' && '🔄 Changes Detected' || 'âšī¸ No Changes' }}" >> $GITHUB_STEP_SUMMARY + if ${{ steps.spec_diff.outputs.spec_diff == 'false' }}; then + echo "| Outcome Previous Run | ${{ steps.spec_diff.outputs.prev_run_success == 'true' && '✅: Current run succeeds as a result.' || '❌: Current run fails as a result.' }}" >> $GITHUB_STEP_SUMMARY + fi + if ${{ steps.spec_diff.outputs.spec_diff == 'true' }}; then echo "| Client Generation | ${{ steps.generate.outputs.generation_result == 'success' && '✅' || '❌' }} ${{ steps.generate.outputs.generation_result }}" >> $GITHUB_STEP_SUMMARY echo "| Client Compilation | ${{ steps.compile.outputs.compilation_result == 'success' && '✅' || '❌' }} ${{ steps.compile.outputs.compilation_result }}" >> $GITHUB_STEP_SUMMARY @@ -257,6 +300,12 @@ jobs: echo "Client generation failed. Please check the Generate step logs for details." exit 1 + - name: "Fail if no spec changes and previous run failed" + if: steps.spec_diff.outputs.prev_run_success == 'false' + run: | + echo "Previous run failed and there were no spec changes since, thus failing this run as well." + exit 1 + - name: "Slack Notification" if: failure() && github.event.inputs.create-pr == 'true' uses: slackapi/slack-github-action@v2.1.1 From 8f0304b2adeea9c4cd8429cfe44c363c7b3d18be Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Fri, 6 Feb 2026 10:46:22 +0100 Subject: [PATCH 16/19] improve workflow --- .github/workflows/spec-update.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index a1a4d4c3e..4af10794d 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -143,7 +143,7 @@ jobs: - name: "Print spec contents for debugging" run: | - echo "=== Contents of $FILE_PATH ===" + echo "=== Contents of orchestration.yaml ===" cat -n "orchestration/src/main/resources/spec/orchestration.yaml" echo "=== End of file ===" @@ -283,7 +283,7 @@ jobs: echo "| Spec File Changes | ${{ steps.spec_diff.outputs.spec_diff == 'true' && '🔄 Changes Detected' || 'âšī¸ No Changes' }}" >> $GITHUB_STEP_SUMMARY if ${{ steps.spec_diff.outputs.spec_diff == 'false' }}; then - echo "| Outcome Previous Run | ${{ steps.spec_diff.outputs.prev_run_success == 'true' && '✅: Current run succeeds as a result.' || '❌: Current run fails as a result.' }}" >> $GITHUB_STEP_SUMMARY + echo "| Outcome Previous Run | ${{ steps.spec_diff.outputs.prev_run_success == 'true' && '✅ (Current run succeeds as a result.)' || '❌ (Current run fails as a result.)' }}" >> $GITHUB_STEP_SUMMARY fi if ${{ steps.spec_diff.outputs.spec_diff == 'true' }}; then From 2780c685f811be4f1eb7f4ddb03e1cb2ed419fbe Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Fri, 6 Feb 2026 11:08:33 +0100 Subject: [PATCH 17/19] improve workflow --- .github/workflows/spec-update.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 4af10794d..72a946929 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -171,7 +171,6 @@ jobs: PREVIOUS_RUN=$(gh run list \ --workflow "${{ github.workflow }}" \ --branch improve-spec-update-workflow \ - --limit 2 \ --json databaseId,status,conclusion,displayTitle \ --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")))) | .[0]") # todo: change branch above to main From 88c0917e7b5793683d139590cbf7be6c08065572 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Fri, 6 Feb 2026 13:00:23 +0100 Subject: [PATCH 18/19] remove debugging things --- .github/workflows/spec-update.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index 72a946929..cda4b397a 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -141,12 +141,6 @@ jobs: gh api $API_URL -H "Accept: application/vnd.github.raw" > $FILE_PATH - - name: "Print spec contents for debugging" - run: | - echo "=== Contents of orchestration.yaml ===" - cat -n "orchestration/src/main/resources/spec/orchestration.yaml" - echo "=== End of file ===" - - name: "Exit if there are no spec changes" id: spec_diff env: @@ -170,11 +164,9 @@ jobs: # Get the most recent completed run of this workflow on the current branch PREVIOUS_RUN=$(gh run list \ --workflow "${{ github.workflow }}" \ - --branch improve-spec-update-workflow \ + --branch main \ --json databaseId,status,conclusion,displayTitle \ --jq "map(select(.databaseId != ${CURRENT_RUN} and (.displayTitle | contains(\"${RUN_NAME}\")))) | .[0]") - # todo: change branch above to main - # and (.displayTitle == \"${RUN_TOKEN}\") echo "Previous run: $PREVIOUS_RUN" From c708596f0bfaf1ef4deca83c341a859139a39510 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Fri, 6 Feb 2026 13:03:06 +0100 Subject: [PATCH 19/19] small changes --- .github/workflows/spec-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-update.yaml b/.github/workflows/spec-update.yaml index cda4b397a..8216a1982 100644 --- a/.github/workflows/spec-update.yaml +++ b/.github/workflows/spec-update.yaml @@ -161,7 +161,7 @@ jobs: RUN_NAME="Spec File Update Workflow: $CHOICE-$REF" echo "Run name used for search: $RUN_NAME" - # Get the most recent completed run of this workflow on the current branch + # Get the most recent completed run of this workflow with respect to the same feature branch PREVIOUS_RUN=$(gh run list \ --workflow "${{ github.workflow }}" \ --branch main \