diff --git a/.github/actions/setup-supersetbot/action.yml b/.github/actions/setup-supersetbot/action.yml index 155af26c08e45..e2a7034b8599f 100644 --- a/.github/actions/setup-supersetbot/action.yml +++ b/.github/actions/setup-supersetbot/action.yml @@ -1,11 +1,36 @@ name: 'Setup supersetbot' -description: 'Sets up supersetbot npm lib from the repo' +description: 'Sets up supersetbot npm lib from the repo or npm' +inputs: + from-npm: + description: 'Install from npm instead of local setup' + required: false + default: 'true' # Defaults to using the local setup runs: using: 'composite' steps: - - name: Install dependencies + + - name: Setup Node Env + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install supersetbot from npm + if: ${{ inputs.from-npm == 'true' }} shell: bash + run: npm install -g supersetbot + + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + if: ${{ inputs.from-npm == 'false' }} + uses: actions/checkout@v4 + with: + repository: apache-superset/supersetbot + path: supersetbot + + - name: Setup supersetbot from repo + if: ${{ inputs.from-npm == 'false' }} + shell: bash + working-directory: supersetbot run: | - cd .github/supersetbot - npm install - npm link + # simple trick to install globally with dependencies + npm pack + npm install -g ./supersetbot*.tgz diff --git a/.github/supersetbot/.eslintrc.json b/.github/supersetbot/.eslintrc.json deleted file mode 100644 index 22f0d26d28384..0000000000000 --- a/.github/supersetbot/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "airbnb-base", - "rules": { - "import/extensions": 0, - "import/prefer-default-export": 0, - "func-names": 0, - "no-console": 0, - "class-methods-use-this": 0 - }, - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module", - "requireConfigFile": false - }, - "env": { - "jest": true - } -} diff --git a/.github/supersetbot/README.md b/.github/supersetbot/README.md deleted file mode 100644 index 4042e985ce3fc..0000000000000 --- a/.github/supersetbot/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# supersetbot - -supersetbot is a utility bot that can be used to help around GitHub, CI and beyond. - -The bot can be used as a local CLI OR, for a subset of fitted use cases, can be invoked directly -from GitHub comments. - -Because it's its own npm app, it can be tested/deployed/used in isolation from the rest of -Superset, and take on some of the complexity from GitHub actions and onto a nifty -utility that can be used in different contexts. - -## Features - -```bash -$ use nvm 20 -$ npm i -g supersetbot -$ supersetbot -Usage: supersetbot [options] [command] - -Options: - -v, --verbose Output extra debugging information - -r, --repo The GitHub repo to use (ie: "apache/superset") - -d, --dry-run Run the command in dry-run mode - -a, --actor The actor - -h, --help display help for command - -Commands: - label [options]