Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ SLACK_APP_ID= # Printed by `pnpm slack:app create`
SLACK_CLIENT_ID= # Printed by `pnpm slack:app create`
SLACK_CLIENT_SECRET= # Printed by `pnpm slack:app create`
SLACK_SIGNING_SECRET= # Printed by `pnpm slack:app create`
TELEGRAM_API_URL= # Defaults to https://api.telegram.org
TELEGRAM_BOT_TOKEN= # Telegram bot token from BotFather
TELEGRAM_BOT_USERNAME=ggtipbot # Telegram bot username without @
TELEGRAM_WEBHOOK_SECRET_TOKEN= # Secret token passed to Telegram setWebhook
TWITTER_ACCESS_TOKEN= # Twitter/X OAuth 1.0a access token for posting replies
TWITTER_ACCESS_TOKEN_SECRET= # Twitter/X OAuth 1.0a access token secret for posting replies
TWITTER_API_URL= # Defaults to https://api.twitter.com
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/preview_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
sha:
required: true
type: string
telegram_bot_username:
default: ggtipbot
required: false
type: string
twitter_bot_handle:
default: tipbotgg
required: false
Expand All @@ -30,6 +34,10 @@ on:
required: false
SLACK_CONFIG_REFRESH_TOKEN:
required: false
TELEGRAM_BOT_TOKEN:
required: true
TELEGRAM_WEBHOOK_SECRET_TOKEN:
required: true
TWITTER_OAUTH_CLIENT_ID:
required: true
TWITTER_OAUTH_CLIENT_SECRET:
Expand All @@ -47,6 +55,7 @@ env:
SLACK_BOT_DISPLAY_NAME: Tipbot PR ${{ inputs.pr_number }}
SLACK_COMMAND: /tippr${{ inputs.pr_number }}
SLACK_APP_NAME: Tipbot PR ${{ inputs.pr_number }}
TELEGRAM_BOT_USERNAME: ${{ inputs.telegram_bot_username }}
TWITTER_BOT_HANDLE: ${{ inputs.twitter_bot_handle }}
WRANGLER_SEND_METRICS: false

Expand Down Expand Up @@ -367,12 +376,14 @@ jobs:
env:
D1_ID: ${{ steps.d1.outputs.id }}
PR_NUMBER: ${{ inputs.pr_number }}
TELEGRAM_BOT_USERNAME: ${{ env.TELEGRAM_BOT_USERNAME }}
TWITTER_BOT_HANDLE: ${{ vars.TWITTER_BOT_HANDLE || env.TWITTER_BOT_HANDLE }}
run: |
sed -i.bak \
-e "s|__PREVIEW_NAME__|${PREVIEW_NAME}|g" \
-e "s|__PREVIEW_APEX__|${PREVIEW_APEX}|g" \
-e "s|__PREVIEW_PR_NUMBER__|${PR_NUMBER}|g" \
-e "s|__PREVIEW_TELEGRAM_BOT_USERNAME__|${TELEGRAM_BOT_USERNAME}|g" \
-e "s|__PREVIEW_TWITTER_BOT_HANDLE__|${TWITTER_BOT_HANDLE}|g" \
-e "s|__PREVIEW_D1_ID__|${D1_ID}|g" \
wrangler.jsonc
Expand Down Expand Up @@ -426,6 +437,8 @@ jobs:
SLACK_CLIENT_ID
SLACK_CLIENT_SECRET
SLACK_SIGNING_SECRET
TELEGRAM_BOT_TOKEN
TELEGRAM_WEBHOOK_SECRET_TOKEN
TWITTER_OAUTH_CLIENT_ID
TWITTER_OAUTH_CLIENT_SECRET
env:
Expand All @@ -435,6 +448,8 @@ jobs:
SLACK_CLIENT_ID: ${{ steps.slack.outputs.client_id || steps.state.outputs.client_id }}
SLACK_CLIENT_SECRET: ${{ steps.slack.outputs.client_secret || steps.state.outputs.client_secret }}
SLACK_SIGNING_SECRET: ${{ steps.slack.outputs.signing_secret || steps.state.outputs.signing_secret }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_WEBHOOK_SECRET_TOKEN: ${{ secrets.TELEGRAM_WEBHOOK_SECRET_TOKEN }}
TWITTER_OAUTH_CLIENT_ID: ${{ secrets.TWITTER_OAUTH_CLIENT_ID }}
TWITTER_OAUTH_CLIENT_SECRET: ${{ secrets.TWITTER_OAUTH_CLIENT_SECRET }}

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
permissions:
contents: read
uses: ./.github/workflows/check.yml
with:
skip_workers: true

deploy:
name: Deploy
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:
SLACK_CLIENT_ID
SLACK_CLIENT_SECRET
SLACK_SIGNING_SECRET
TELEGRAM_BOT_TOKEN
TELEGRAM_WEBHOOK_SECRET_TOKEN
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
TWITTER_BEARER_TOKEN
Expand All @@ -73,6 +77,8 @@ jobs:
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
SLACK_CLIENT_SECRET: ${{ secrets.SLACK_CLIENT_SECRET }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_WEBHOOK_SECRET_TOKEN: ${{ secrets.TELEGRAM_WEBHOOK_SECRET_TOKEN }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
TWITTER_BEARER_TOKEN: ${{ secrets.TWITTER_BEARER_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
check:
name: Check
uses: ./.github/workflows/check.yml
with:
skip_workers: true

preview:
name: Preview
Expand All @@ -31,6 +33,7 @@ jobs:
with:
pr_number: ${{ github.event.pull_request.number }}
sha: ${{ github.event.pull_request.head.sha }}
telegram_bot_username: ${{ vars.TELEGRAM_BOT_USERNAME || 'ggtipbot' }}
twitter_bot_handle: ${{ vars.TWITTER_BOT_HANDLE || 'tipbotgg' }}
secrets:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand All @@ -41,5 +44,7 @@ jobs:
SLACK_CONFIG_ACCESS_TOKEN: ${{ secrets.SLACK_CONFIG_ACCESS_TOKEN }}
SLACK_CONFIG_REFRESH_TOKEN: ${{ secrets.SLACK_CONFIG_REFRESH_TOKEN }}
SLACK_GH_TOKEN: ${{ secrets.SLACK_GH_TOKEN }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_WEBHOOK_SECRET_TOKEN: ${{ secrets.TELEGRAM_WEBHOOK_SECRET_TOKEN }}
TWITTER_OAUTH_CLIENT_ID: ${{ secrets.TWITTER_OAUTH_CLIENT_ID }}
TWITTER_OAUTH_CLIENT_SECRET: ${{ secrets.TWITTER_OAUTH_CLIENT_SECRET }}
Loading
Loading