From 4e2f18ac4c37cbcaf3cfd1a5010027e0cb9143c7 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Mon, 20 Jun 2022 21:01:17 +0200 Subject: [PATCH] refactor: rename repo to `tauri-github-bot` --- .github/workflows/deploy.yml | 18 ++++++------------ README.md | 4 ++-- package.json | 6 +++--- src/constants.ts | 3 +-- src/index.ts | 4 ++-- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8dcc70a..1c91c7a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,21 +8,15 @@ on: jobs: deploy: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16] steps: - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7 - uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} - - name: Cache .pnpm-store - uses: actions/cache@v2 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: Install pnpm - run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6 + node-version: 16 + cache: 'pnpm' - run: pnpm i - run: pnpm build - run: pnpm type-check @@ -32,4 +26,4 @@ jobs: key: ${{ secrets.DIGITAL_OCEAN_SSH_KEY }} known_hosts: ${{ secrets.DIGITAL_OCEAN_SSH_KNOWN_HOSTS }} - name: Deploy to DigitalOcean - run: ssh ${{ secrets.DIGITAL_OCEAN_SSH_USERNAME }}@${{ secrets.DIGITAL_OCEAN_SSH_HOST }} "cd ~/tauri-apps-bot && git pull && rm .env; echo 'APP_ID=${{ secrets.APP_ID }}' >> .env && echo 'WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}' >> .env && echo 'TAURI_BOT_ACC_TOKEN=${{ secrets.TAURI_BOT_ACC_TOKEN }}' >> .env && echo 'PORT=9000' >> .env && echo '${{ secrets.PRIVATE_KEY }}' >> tauri-apps.2021-12-31.private-key.pem && ls -lah && pnpm i && pnpm build && pm2 delete 'tauri-apps-github-bot' ; pm2 start node --time --name 'tauri-apps-github-bot' -- ./node_modules/probot/bin/probot.js run ./dist/index.js" + run: ssh ${{ secrets.DIGITAL_OCEAN_SSH_USERNAME }}@${{ secrets.DIGITAL_OCEAN_SSH_HOST }} "cd ~/tauri-github-bot && git pull && rm .env; echo 'APP_ID=${{ secrets.APP_ID }}' >> .env && echo 'WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}' >> .env && echo 'TAURI_BOT_ACC_TOKEN=${{ secrets.TAURI_BOT_ACC_TOKEN }}' >> .env && echo 'PORT=9000' >> .env && echo '${{ secrets.PRIVATE_KEY }}' > tauri-github-bot.private-key.pem && ls -lah && pnpm i && pnpm build && pm2 delete 'tauri-github-bot' ; pm2 start node --time --name 'tauri-github-bot' -- ./node_modules/probot/bin/probot.js run ./dist/index.js" diff --git a/README.md b/README.md index 0f09124..3023775 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# tauri-apps-bot -A bot for tauri-apps org to automate various tasks and intended to used only by tauri-apps org. +# tauri-github-bot +A GitHub bot for tauri-apps org to automate various tasks and intended to used only by tauri-apps org members. ## Commands: > Commands are comments on issues or pull requests, that start with a special syntax. diff --git a/package.json b/package.json index db6867a..1a08e28 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "tauri-apps-bot", + "name": "tauri-github-bot", "version": "1.0.0", "private": true, - "description": "A bot for tauri-apps to automate various tasks.", + "description": "A GitHub bot for tauri-apps org to automate various tasks and intended to used only by tauri-apps org members.", "license": "MIT OR Apache-2.0", - "homepage": "https://github.com/tauri-apps/tauri-apps-bot", + "homepage": "https://github.com/tauri-apps/tauri-github-bot", "keywords": [ "probot", "github", diff --git a/src/constants.ts b/src/constants.ts index 2a8ba96..4b5b365 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,7 +1,6 @@ import { Octokit } from '@octokit/rest' -/** the Github App (bot) name */ -export const TAURI_APPS_BOT = 'tauri-apps[bot]' +export const TAURI_GITHUB_BOT = 'tauri-apps[bot]' /** https://github.com/tauri-bot account */ export const TAURI_BOT_ACC = 'tauri-bot' export const TAURI_BOT_ACC_TOKEN = process.env.TAURI_BOT_ACC_TOKEN diff --git a/src/index.ts b/src/index.ts index 69f93e7..8b6f502 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import { Octokit } from '@octokit/rest' import { Probot } from 'probot' import { COMMAND_REGEX, - TAURI_APPS_BOT, + TAURI_GITHUB_BOT, TAURI_BOT_ACC, TAURI_BOT_ACC_OCTOKIT, TAURI_ORG, @@ -71,7 +71,7 @@ export default (app: Probot): void => { // an issue is closed in a tauri-apps repo repository.owner.login === TAURI_ORG && // and was created by our bot - (issue.user.login === TAURI_APPS_BOT || + (issue.user.login === TAURI_GITHUB_BOT || // or was created by tauri-bot account issue.user.login === TAURI_BOT_ACC) && // and it was from an upstream command