2024-03-13 19:26:48 -04:00
|
|
|
name: SupersetBot Workflow
|
|
|
|
|
|
|
|
on:
|
|
|
|
issue_comment:
|
|
|
|
types: [created, edited]
|
|
|
|
|
|
|
|
# Making the workflow testable since `issue_comment` only triggers on
|
|
|
|
# the default branch
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
comment_body:
|
|
|
|
description: 'Comment Body'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
supersetbot:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: >
|
|
|
|
github.event_name == 'workflow_dispatch' ||
|
|
|
|
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@supersetbot'))
|
2024-04-02 23:28:00 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
issues: write
|
2024-03-13 19:26:48 -04:00
|
|
|
steps:
|
|
|
|
- name: Quickly add thumbs up!
|
2024-04-02 23:28:00 -04:00
|
|
|
if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '@supersetbot')
|
2024-04-02 10:46:42 -04:00
|
|
|
uses: actions/github-script@v7
|
2024-03-13 19:26:48 -04:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/')
|
|
|
|
await github.rest.reactions.createForIssueComment({
|
|
|
|
owner,
|
|
|
|
repo,
|
2024-04-02 23:28:00 -04:00
|
|
|
comment_id: context.payload.comment.id,
|
2024-03-13 19:26:48 -04:00
|
|
|
content: '+1'
|
|
|
|
});
|
2024-03-25 11:58:22 -04:00
|
|
|
|
2024-04-02 23:28:00 -04:00
|
|
|
- name: "Checkout ( ${{ github.sha }} )"
|
2024-03-25 11:58:22 -04:00
|
|
|
uses: actions/checkout@v4
|
2024-04-02 23:28:00 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2024-03-25 11:58:22 -04:00
|
|
|
|
|
|
|
- name: Setup supersetbot
|
|
|
|
uses: ./.github/actions/setup-supersetbot/
|
|
|
|
|
2024-03-13 19:26:48 -04:00
|
|
|
- name: Execute custom Node.js script
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
GITHUB_ACTOR: ${{ github.actor }}
|
|
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
|
|
GITHUB_ISSUE_NUMBER: ${{ github.event.issue.number }}
|
2024-04-02 23:28:00 -04:00
|
|
|
COMMENT_BODY: ${{ github.event.comment.body }}${{ github.event.inputs.comment_body }}
|
2024-03-13 19:26:48 -04:00
|
|
|
run: |
|
2024-04-02 23:28:00 -04:00
|
|
|
supersetbot run "$COMMENT_BODY"
|