Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix JS stack downstream cascade and workflow input passing.
Use a single jq call in get_downstream so stdin is not consumed twice,
write branch_map to a file to avoid GHA expression brace mangling, and
encode pr_body with toJSON so multiline ci: tags survive reusable workflow inputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
  • Loading branch information
nolanpro and cursoragent committed Sep 22, 2026
commit 03abb73569ad894026752ee00f539c6afa9556f3
12 changes: 7 additions & 5 deletions .github/scripts/js-stack-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ resolve_ref() {
}

get_downstream() {
if ! jq -e '.processmaker | has("downstream")' >/dev/null; then
echo "::error::processmaker.downstream is required in package.json" >&2
exit 1
fi
jq -r '.processmaker.downstream[]?'
jq -r '
if (.processmaker | has("downstream")) then
.processmaker.downstream[]?
else
error("processmaker.downstream is required in package.json")
end
'
}

get_build_command() {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pm4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
trigger_repo: ${{ github.event.pull_request.head.repo.name || github.event.repository.name || 'processmaker' }}
trigger_ref: ${{ github.event.pull_request.head.ref || github.event.ref || 'develop' }}
pr_body: ${{ github.event_name == 'schedule' && '' || github.event.pull_request.body }}
pr_body: ${{ github.event_name == 'schedule' && toJSON('') || toJSON(github.event.pull_request.body || '') }}
stack_id: ${{ github.event.pull_request.number || github.run_id }}

imageEKS:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/js-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN || github.token }}
INPUT_BRANCH_MAP: ${{ inputs.branch_map }}
INPUT_PR_BODY: ${{ inputs.pr_body }}
INPUT_PR_BODY: ${{ inputs.pr_body != '' && fromJSON(inputs.pr_body) || '' }}
TRIGGER_REPO: ${{ inputs.trigger_repo }}
TRIGGER_REF: ${{ inputs.trigger_ref }}
TRIGGER_BRANCH: ${{ inputs.trigger_branch }}
Expand All @@ -101,20 +101,20 @@ jobs:
merged=$(echo "$merged" | jq --arg r "$TRIGGER_REPO" --arg ref "$TRIGGER_REF" '. + {($r): $ref}')
fi

echo "branch_map=$(echo "$merged" | jq -c .)" >> "$GITHUB_OUTPUT"
echo "Resolved branch map: $(echo "$merged" | jq .)"
echo "$merged" | jq -c . > branch_map.json
echo "Resolved branch map: $(jq . branch_map.json)"

- name: Build JS stack
id: build
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN || github.token }}
BRANCH_MAP: ${{ steps.branches.outputs.branch_map }}
TRIGGER_REPO: ${{ inputs.trigger_repo }}
TRIGGER_REF: ${{ inputs.trigger_ref }}
TRIGGER_BRANCH: ${{ inputs.trigger_branch }}
STACK_DIR: js-stack
run: |
set -euo pipefail
export BRANCH_MAP="$(jq -c . branch_map.json)"
bash .github/scripts/js-stack-build.sh

count=$(jq 'length' js-stack/manifest.json)
Expand Down