mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-28 05:12:26 +00:00
Closes #181 — trim() is not a valid GitHub Actions expression function, causing the job to fail on every trigger. Use the raw comment body instead.
30 lines
936 B
YAML
30 lines
936 B
YAML
name: Auto-assign on "take"
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
issues: write
|
|
|
|
jobs:
|
|
assign:
|
|
if: >-
|
|
!github.event.issue.pull_request
|
|
&& contains(fromJSON('["take", "Take", "TAKE"]'), github.event.comment.body)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Assign commenter
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
COMMENTER="${{ github.event.comment.user.login }}"
|
|
ISSUE="${{ github.event.issue.number }}"
|
|
CURRENT=$(gh issue view "$ISSUE" --repo "${{ github.repository }}" --json assignees --jq '.assignees[].login' 2>/dev/null)
|
|
if echo "$CURRENT" | grep -qx "$COMMENTER"; then
|
|
echo "$COMMENTER is already assigned to #$ISSUE"
|
|
else
|
|
gh issue edit "$ISSUE" --repo "${{ github.repository }}" --add-assignee "$COMMENTER"
|
|
echo "Assigned $COMMENTER to #$ISSUE"
|
|
fi
|