feat: move supersetbot out of repo (#27647)

This commit is contained in:
Maxime Beauchemin
2024-04-02 20:28:00 -07:00
committed by GitHub
parent 9022f5c519
commit 8e3cecda9f
23 changed files with 50 additions and 12539 deletions

View File

@@ -51,13 +51,10 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Node Env
uses: actions/setup-node@v4
with:
node-version: '20'
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup supersetbot
uses: ./.github/actions/setup-supersetbot/

View File

@@ -52,11 +52,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Node Env
uses: actions/setup-node@v4
with:
node-version: '20'
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:

View File

@@ -10,19 +10,21 @@ on:
jobs:
superbot-orglabel:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Execute SupersetBot Command
uses: actions/setup-node@v4
with:
node-version: '20'
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup supersetbot
uses: ./.github/actions/setup-supersetbot/
- name: Execute custom Node.js script
- name: Execute supersetbot orglabel command
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |

View File

@@ -19,8 +19,13 @@ jobs:
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@supersetbot'))
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Quickly add thumbs up!
if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '@supersetbot')
uses: actions/github-script@v7
with:
script: |
@@ -28,16 +33,14 @@ jobs:
await github.rest.reactions.createForIssueComment({
owner,
repo,
comment_id: ${{ github.event.comment.id }},
comment_id: context.payload.comment.id,
content: '+1'
});
- name: Execute SupersetBot Command
uses: actions/setup-node@v4
with:
node-version: '20'
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: "Checkout ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup supersetbot
uses: ./.github/actions/setup-supersetbot/
@@ -48,16 +51,6 @@ jobs:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_ISSUE_NUMBER: ${{ github.event.issue.number }}
COMMENT_BODY: ${{ github.event.comment.body }}
INPUT_COMMENT_BODY: ${{ github.event.inputs.comment_body }}
COMMENT_BODY: ${{ github.event.comment.body }}${{ github.event.inputs.comment_body }}
run: |
cat <<EOF > script.js
const run = async () => {
const { runCommandFromGithubAction } = await import('supersetbot');
const cmd = process.env.COMMENT_BODY || process.env.INPUT_COMMENT_BODY;
console.log("Executing: ", cmd);
await runCommandFromGithubAction(cmd);
};
run().catch(console.error);
EOF
node script.js
supersetbot run "$COMMENT_BODY"