From c8fe96681a9856d41b19c790556472c51f92d822 Mon Sep 17 00:00:00 2001 From: kerthcet Date: Mon, 24 Jun 2024 00:48:59 +0800 Subject: [PATCH] fix Signed-off-by: kerthcet --- .github/workflows/kube-actions.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/kube-actions.yaml b/.github/workflows/kube-actions.yaml index fafa7e3..bc7e9e4 100644 --- a/.github/workflows/kube-actions.yaml +++ b/.github/workflows/kube-actions.yaml @@ -8,6 +8,7 @@ on: - labeled - synchronize +# FIXME: The global env seems not work. env: GH_TOKEN: ${{ secrets.AGENT_TOKEN }} @@ -21,6 +22,8 @@ jobs: - name: Remove lgtm label on new push if: github.event_name == 'pull_request' && github.event.action == 'synchronize' + env: + GH_TOKEN: ${{ secrets.AGENT_TOKEN }} run: | PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH) @@ -44,6 +47,8 @@ jobs: - name: Handle PR Comments if: github.event_name == 'issue_comment' && github.event.action == 'created' + env: + GH_TOKEN: ${{ secrets.AGENT_TOKEN }} run: | COMMENT_BODY=$(jq -r '.comment.body' $GITHUB_EVENT_PATH) PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH) @@ -132,6 +137,8 @@ jobs: - name: Merge PR if approved and lgtm if: github.event_name == 'pull_request' && github.event.action == 'labeled' + env: + GH_TOKEN: ${{ secrets.AGENT_TOKEN }} run: | LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name') if [[ "$LABELS" == *"lgtm"* && "$LABELS" == *"approved"* && "$LABELS" != *"do-not-merge/hold"* ]]; then