Skip to content

remove: teen age-rating #337

remove: teen age-rating

remove: teen age-rating #337

Workflow file for this run

name: AI Pull Request Review
on:
workflow_dispatch:
pull_request:
types: [labeled]
issue_comment:
types: [created, edited]
jobs:
check-member:
runs-on: ubuntu-latest
outputs:
is-member: ${{ steps.check.outputs.is-member }}
steps:
- name: Check if user is organization member
id: check
env:
SENDER_LOGIN: ${{ github.event.sender.login }}
COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
ACTOR: ${{ github.actor }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
USERNAME="$SENDER_LOGIN"
elif [ "${{ github.event_name }}" = "issue_comment" ]; then
USERNAME="$COMMENT_USER_LOGIN"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
USERNAME="$ACTOR"
else
echo "is-member=false" >> $GITHUB_OUTPUT
exit 0
fi
ORG="decentraland"
# Use private endpoint with token and check HTTP status
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token ${{ secrets.PAT_GITHUB }}" \
"https://api.github.com/orgs/$ORG/members/$USERNAME")
if [ "$HTTP_CODE" = "204" ]; then
echo "is-member=true" >> $GITHUB_OUTPUT
else
echo "is-member=false" >> $GITHUB_OUTPUT
fi
ai-review:
needs: check-member
if: |
needs.check-member.outputs.is-member == 'true' && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && github.event.label.name == 'ai-review') ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body == 'ai-review' &&
github.event.comment.user.type == 'User')
)
uses: decentraland/actions/.github/workflows/ai-pr-review.yml@main
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}