diff --git a/.github/workflows/kube-actions.yaml b/.github/workflows/kube-actions.yaml index a6c5eea..413cc84 100644 --- a/.github/workflows/kube-actions.yaml +++ b/.github/workflows/kube-actions.yaml @@ -8,6 +8,9 @@ on: - labeled - synchronize +env: + GH_TOKEN: ${{ secrets.AGENT_TOKEN }} + jobs: pr-workflow: runs-on: ubuntu-latest @@ -18,8 +21,6 @@ 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) @@ -33,6 +34,8 @@ jobs: echo "Removed 'lgtm' label due to new push." fi + exit 0 + - name: Set up Python uses: actions/setup-python@v4 with: @@ -43,8 +46,6 @@ 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) @@ -131,10 +132,10 @@ jobs: fi done <<< "$COMMENT_BODY" + exit 0 + - 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 @@ -143,3 +144,5 @@ jobs: else echo "Not ready to merge" fi + + exit 0