Skip to content

Commit

Permalink
Merge pull request #37 from kerthcet/fix/workflow
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
InftyAI-Agent authored Jun 23, 2024
2 parents 0f0feca + c8fe966 commit eab7e90
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/kube-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- labeled
- synchronize

# FIXME: The global env seems not work.
env:
GH_TOKEN: ${{ secrets.AGENT_TOKEN }}

Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eab7e90

Please sign in to comment.