Skip to content

LLM responds to issues against the repository.πŸš€ #3

LLM responds to issues against the repository.πŸš€

LLM responds to issues against the repository.πŸš€ #3

Workflow file for this run

name: "Alert-Menta: Reacts to specific commands"
run-name: LLM responds to issues against the repository.πŸš€
on:
issue_comment:
types: [created]
jobs:
Alert-Menta:
if: startsWith(github.event.comment.body, '/describe') || startsWith(github.event.comment.body, '/suggest') || startsWith(github.event.comment.body, '/ask')
runs-on: ubuntu-22.04
permissions:
issues: write
contents: read
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Download and Install alert-menta
run: |
curl -sLJO -H 'Accept: application/octet-stream' \
"https://${{ secrets.GH_TOKEN }}@api.github.com/repos/3-shake/alert-menta/releases/assets/$( \
curl -sL "https://${{ secrets.GH_TOKEN }}@api.github.com/repos/3-shake/alert-menta/releases/tags/v0.1.0" \
| jq '.assets[] | select(.name | contains("Linux_x86")) | .id')"
tar -zxvf alert-menta_Linux_x86_64.tar.gz
- name: Set Command
id: set_command
run: |
COMMENT_BODY="${{ github.event.comment.body }}"
if [[ "$COMMENT_BODY" == /ask* ]]; then
COMMAND=ask
INTENT=${COMMENT_BODY:5}
echo "INTENT=$INTENT" >> $GITHUB_ENV
elif [[ "$COMMENT_BODY" == /describe* ]]; then
COMMAND=describe
elif [[ "$COMMENT_BODY" == /suggest* ]]; then
COMMAND=suggest
fi
echo "COMMAND=$COMMAND" >> $GITHUB_ENV
- run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
- name: Get user defined config file
id: user_config
if: hashFiles('.alert-menta.user.yaml') != ''
run: |
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" -L -o .alert-menta.user.yaml "https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}/main/.alert-menta.user.yaml" && echo "CONFIG_FILE=./.alert-menta.user.yaml" >> $GITHUB_ENV
- name: Add Comment
run: |
if [[ "$COMMAND" == "ask" ]]; then
./alert-menta -owner ${{ github.repository_owner }} -issue ${{ github.event.issue.number }} -repo ${{ env.REPOSITORY_NAME }} -github-token ${{ secrets.GH_TOKEN }} -api-key ${{ secrets.OPENAI_API_KEY }} -command $COMMAND -config $CONFIG_FILE -intent "$INTENT"
else
./alert-menta -owner ${{ github.repository_owner }} -issue ${{ github.event.issue.number }} -repo ${{ env.REPOSITORY_NAME }} -github-token ${{ secrets.GH_TOKEN }} -api-key ${{ secrets.OPENAI_API_KEY }} -command $COMMAND -config $CONFIG_FILE
fi