99 default : " main"
1010 type : string
1111 marketplace_version :
12- description : " New marketplace version using stable X.Y.Z format"
13- required : true
12+ description : " Optional new marketplace version using stable X.Y.Z format"
13+ required : false
1414 type : string
1515
1616permissions :
1717 contents : read
1818
19+ env :
20+ CANVAS_SOURCE_REF : ${{ inputs.source_ref || 'main' }}
21+ MARKETPLACE_VERSION : ${{ inputs.marketplace_version || '' }}
22+
1923concurrency :
2024 group : sync-foundry-agent-canvas
2125 cancel-in-progress : false
3438 uses : actions/checkout@v4
3539 with :
3640 repository : SmallBlackHole/foundry-agent-canvas
37- ref : ${{ inputs.source_ref }}
41+ ref : ${{ env.CANVAS_SOURCE_REF }}
3842 path : source
3943 persist-credentials : false
4044
9296 contents : read
9397
9498 steps :
99+ - name : Checkout workflow automation
100+ uses : actions/checkout@v4
101+ with :
102+ ref : ${{ github.sha }}
103+ path : automation
104+ persist-credentials : false
105+
95106 - name : Generate GitHub App token
96107 id : app-token
97108 uses : actions/create-github-app-token@v1
@@ -115,11 +126,35 @@ jobs:
115126
116127 - name : Sync runtime package
117128 run : |
118- node target /.github/scripts/sync_foundry_agent_canvas.mjs \
129+ node automation /.github/scripts/sync_foundry_agent_canvas.mjs \
119130 bundle \
120131 target/foundry-agent-canvas/extensions/foundry-agent-canvas \
121132 target/foundry-agent-canvas/.github/plugin/plugin.json \
122- "${{ inputs.marketplace_version }}"
133+ "$MARKETPLACE_VERSION"
134+
135+ - name : Resolve pull request metadata
136+ id : metadata
137+ shell : bash
138+ env :
139+ SOURCE_SHORT_SHA : ${{ needs.build.outputs.source_short_sha }}
140+ run : |
141+ set -euo pipefail
142+
143+ if [[ -n "$MARKETPLACE_VERSION" ]]; then
144+ branch_suffix="v$MARKETPLACE_VERSION"
145+ title="chore: sync foundry-agent-canvas v$MARKETPLACE_VERSION"
146+ version_label="$MARKETPLACE_VERSION"
147+ else
148+ branch_suffix="$SOURCE_SHORT_SHA"
149+ title="chore: sync foundry-agent-canvas ($SOURCE_SHORT_SHA)"
150+ version_label="unchanged"
151+ fi
152+
153+ {
154+ echo "branch_suffix=$branch_suffix"
155+ echo "title=$title"
156+ echo "version_label=$version_label"
157+ } >> "$GITHUB_OUTPUT"
123158
124159 - name : Detect package changes
125160 id : diff
@@ -146,7 +181,7 @@ jobs:
146181 echo "## Foundry Agent Canvas Sync"
147182 echo
148183 echo "- Source: \`SmallBlackHole/foundry-agent-canvas@${{ needs.build.outputs.source_sha }}\`"
149- echo "- Marketplace version: \`${{ inputs.marketplace_version }}\`"
184+ echo "- Marketplace version: \`${{ steps.metadata.outputs.version_label }}\`"
150185 echo
151186 echo "### Changed files"
152187 echo
@@ -163,20 +198,20 @@ jobs:
163198 token : ${{ steps.app-token.outputs.token }}
164199 path : target
165200 base : main
166- branch : bot/sync-foundry-agent-canvas-v ${{ inputs.marketplace_version }}
201+ branch : bot/sync-foundry-agent-canvas-${{ steps.metadata.outputs.branch_suffix }}
167202 delete-branch : true
168203 draft : always-true
169- commit-message : " chore: sync foundry-agent-canvas v ${{ inputs.marketplace_version }}"
170- title : " chore: sync foundry-agent-canvas v ${{ inputs.marketplace_version }}"
204+ commit-message : ${{ steps.metadata.outputs.title }}
205+ title : ${{ steps.metadata.outputs.title }}
171206 body : |
172207 ## Summary
173208 This automated draft PR updates the bundled Foundry Agent Canvas runtime.
174209
175210 ## Source
176211 - Repository: `SmallBlackHole/foundry-agent-canvas`
177- - Requested ref: `${{ inputs.source_ref }}`
212+ - Requested ref: `${{ env.CANVAS_SOURCE_REF }}`
178213 - Resolved commit: `${{ needs.build.outputs.source_sha }}`
179- - Marketplace version: `${{ inputs.marketplace_version }}`
214+ - Marketplace version: `${{ steps.metadata.outputs.version_label }}`
180215 - Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
181216
182217 ## Validation
0 commit comments