Skip to content

activator

activator #5

Workflow file for this run

name: activator
on:
issue_comment:
types:
- created
permissions:
contents: write
pull-requests: write
issues: write
jobs:
activator-ghclient:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/activator')
container:
image: ghcr.io/jonathanalgar/activator-ghclient:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Add reaction to comment
run: |
COMMENT_ID=${{ github.event.comment.id }}
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"content":"eyes"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/comments/$COMMENT_ID/reactions"
- name: Set ref for checkout
id: set_ref
run: |
PR_API_URL="${{ github.event.issue.pull_request.url }}"
REF=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $PR_API_URL | jq -r .head.ref)
echo "REF=$REF" >> $GITHUB_ENV
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ env.REF }}
- name: Run script
env:
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.issue.number }}
ACTIVATOR_ENDPOINT: ${{ secrets.ACTIVATOR_ENDPOINT }}
ACTIVATOR_TOKEN: ${{ secrets.ACTIVATOR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_ID: ${{ github.event.comment.id }}
run: python /app/activator-ghclient.py