Skip to content

Commit ad66814

Browse files
authored
Fix label sync workflow JSON parsing (#50)
Pass labels JSON via environment variable and parse with JSON.parse() instead of using fromJSON() inline in the script. The fromJSON() function doesn't work correctly when used inline in github-script blocks. This fixes the workflow failure where labels was being set to `Array` instead of the actual array contents. Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent c74f639 commit ad66814

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/sync-labels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ jobs:
113113

114114
- name: Sync labels
115115
uses: actions/github-script@v8
116+
env:
117+
LABELS_JSON: ${{ needs.init.outputs.labels }}
116118
with:
117119
github-token: ${{ steps.token.outputs.token }}
118120
script: |
119-
const labels = ${{ fromJSON(needs.init.outputs.labels) }};
121+
const labels = JSON.parse(process.env.LABELS_JSON);
120122
const owner = context.repo.owner;
121123
const repo = '${{ matrix.repo }}';
122124

0 commit comments

Comments
 (0)