From ee43b3ec76b977f42bb67c1b38707bf670f9ed5d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 17:16:54 +0000 Subject: [PATCH] CLDC-4263: separate comment workflow --- .github/workflows/review_app_hint.yml | 24 ++++++++++++++++++++++++ .github/workflows/review_pipeline.yml | 27 --------------------------- 2 files changed, 24 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/review_app_hint.yml diff --git a/.github/workflows/review_app_hint.yml b/.github/workflows/review_app_hint.yml new file mode 100644 index 000000000..f54cd6345 --- /dev/null +++ b/.github/workflows/review_app_hint.yml @@ -0,0 +1,24 @@ +name: Review app hint + +on: + pull_request: + types: [opened] + +jobs: + hint: + name: Add review app hint + if: "!contains(github.event.pull_request.labels.*.name, 'deploy-review')" + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Comment on PR + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: 'To deploy a review app for this PR, add the `deploy-review` label.', + }); diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 7d8d38392..9344b5e5b 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -6,7 +6,6 @@ concurrency: on: pull_request: types: - - opened - synchronize - reopened - labeled @@ -17,32 +16,6 @@ defaults: shell: bash jobs: - hint: - name: Add review app hint - if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'deploy-review') - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Comment on PR - uses: actions/github-script@v7 - with: - script: | - const msg = 'To deploy a review app for this PR, add the `deploy-review` label.'; - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); - if (!comments.find(c => c.body.startsWith('To deploy a review app'))) { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: msg, - }); - } - infra: name: Deploy review app infrastructure if: contains(github.event.pull_request.labels.*.name, 'deploy-review')