From 8b02aff6290d30f1d69c7aa2d77b647ad37f297e Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 18 Jan 2026 12:31:25 +0100 Subject: [PATCH] fix: fix YAML parsing issues in PR gate workflows - Wrap if condition in ${{ }} to avoid YAML tag interpretation - Use array.join for multiline message to avoid block scalar issues --- .github/workflows/approve-contributor.yml | 2 +- .github/workflows/pr-gate.yml | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/approve-contributor.yml b/.github/workflows/approve-contributor.yml index cf7dca24..8f18647b 100644 --- a/.github/workflows/approve-contributor.yml +++ b/.github/workflows/approve-contributor.yml @@ -6,7 +6,7 @@ on: jobs: approve: - if: !github.event.issue.pull_request + if: ${{ !github.event.issue.pull_request }} runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/pr-gate.yml b/.github/workflows/pr-gate.yml index 4600c254..ad7c7ba8 100644 --- a/.github/workflows/pr-gate.yml +++ b/.github/workflows/pr-gate.yml @@ -62,16 +62,18 @@ jobs: // Not approved - close PR with comment console.log(`${prAuthor} is not approved, closing PR`); - const message = `Hi @${prAuthor}, thanks for your interest in contributing! - -We ask new contributors to open an issue first before submitting a PR. This helps us discuss the approach and avoid wasted effort. - -**Next steps:** -1. Open an issue describing what you want to change and why (keep it concise, write in your human voice, AI slop will be closed) -2. Once a maintainer approves with \`lgtm\`, you'll be added to the approved contributors list -3. Then you can submit your PR - -This PR will be closed automatically. See https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md for more details.`; + const message = [ + `Hi @${prAuthor}, thanks for your interest in contributing!`, + '', + 'We ask new contributors to open an issue first before submitting a PR. This helps us discuss the approach and avoid wasted effort.', + '', + '**Next steps:**', + '1. Open an issue describing what you want to change and why (keep it concise, write in your human voice, AI slop will be closed)', + '2. Once a maintainer approves with `lgtm`, you\'ll be added to the approved contributors list', + '3. Then you can submit your PR', + '', + `This PR will be closed automatically. See https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md for more details.` + ].join('\n'); await github.rest.issues.createComment({ owner: context.repo.owner,