Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #39

Merged
merged 1 commit into from
Jun 24, 2024
Merged

fix #39

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/kube-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ env:
GH_TOKEN: ${{ secrets.AGENT_TOKEN }}

jobs:
pr-workflow:
on-new-push:
if: github.event_name == 'pull_request' && github.event.action == 'synchronize'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Remove lgtm label on new push
if: github.event_name == 'pull_request' && github.event.action == 'synchronize'
run: |
PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH)

Expand All @@ -34,7 +34,13 @@ jobs:
echo "Removed 'lgtm' label due to new push."
fi

exit 0
on-issue-comments:
if: github.event_name == 'issue_comment' && github.event.action == 'created'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -44,8 +50,7 @@ jobs:
- name: Install yq
run: pip install yq

- name: Handle PR Comments
if: github.event_name == 'issue_comment' && github.event.action == 'created'
- name: Handle Issue Comments
run: |
COMMENT_BODY=$(jq -r '.comment.body' $GITHUB_EVENT_PATH)
PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH)
Expand Down Expand Up @@ -132,10 +137,15 @@ jobs:
fi
done <<< "$COMMENT_BODY"

exit 0
on-label-updates:
if: github.event_name == 'pull_request' && github.event.action == 'labeled'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Merge PR if approved and lgtm
if: github.event_name == 'pull_request' && github.event.action == 'labeled'
run: |
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
if [[ "$LABELS" == *"lgtm"* && "$LABELS" == *"approved"* && "$LABELS" != *"do-not-merge/hold"* ]]; then
Expand All @@ -144,5 +154,3 @@ jobs:
else
echo "Not ready to merge"
fi

exit 0
Loading