refactor: rename repo to tauri-github-bot

This commit is contained in:
amrbashir
2022-06-20 21:01:17 +02:00
parent 05d06558fd
commit 4e2f18ac4c
5 changed files with 14 additions and 21 deletions

View File

@@ -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"

View File

@@ -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.

View File

@@ -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",

View File

@@ -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

View File

@@ -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