From 20e8c2287a1a58aaeef521fe805000163d73f154 Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Sun, 27 Oct 2024 19:39:18 -0700 Subject: [PATCH] Add Conditional --- .github/workflows/pr-backport-autotrigger.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pr-backport-autotrigger.yml b/.github/workflows/pr-backport-autotrigger.yml index 05752b147..bf5bb6ba9 100644 --- a/.github/workflows/pr-backport-autotrigger.yml +++ b/.github/workflows/pr-backport-autotrigger.yml @@ -28,6 +28,16 @@ jobs: git config --global user.email "yuhongsun96@gmail.com" # Configure Git to use the PAT for authentication git remote set-url origin https://yuhongsun96:${{ secrets.YUHONG_GH_ACTIONS }}@github.com/${{ github.repository }}.git + + - name: Check for Backport Checkbox + id: checkbox-check + run: | + PR_BODY="${{ github.event.pull_request.body }}" + if [[ "$PR_BODY" == *"[x] This PR should be backported"* ]]; then + echo "backport=true" >> $GITHUB_OUTPUT + else + echo "backport=false" >> $GITHUB_OUTPUT + fi - name: List and sort release branches id: list-branches