Skip to content

Commit 9dabf08

Browse files
committed
feat: add direct Schwab workflow mode
1 parent 76613a6 commit 9dabf08

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ name: Schwab Token Auto Refresher
33
on:
44
schedule:
55
- cron: '0 13 */3 * *'
6-
workflow_dispatch:
6+
workflow_dispatch:
7+
inputs:
8+
proxy_mode:
9+
description: 'Schwab outbound mode for manual runs'
10+
required: true
11+
default: proxy
12+
type: choice
13+
options:
14+
- proxy
15+
- direct
716

817
permissions:
918
contents: write
@@ -22,6 +31,17 @@ jobs:
2231
with:
2332
node-version: '20'
2433

34+
- name: Resolve Schwab proxy mode
35+
shell: bash
36+
run: |
37+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.proxy_mode }}" = "direct" ]; then
38+
printf 'SCHWAB_PROXY_URL=\n' >> "$GITHUB_ENV"
39+
echo "Resolved Schwab proxy mode: direct"
40+
else
41+
printf 'SCHWAB_PROXY_URL=%s\n' "${{ secrets.SCHWAB_PROXY_URL }}" >> "$GITHUB_ENV"
42+
echo "Resolved Schwab proxy mode: proxy"
43+
fi
44+
2545
- name: Install Pinned Google Chrome & Dependencies
2646
run: |
2747
sudo apt-get update
@@ -36,7 +56,6 @@ jobs:
3656
run: npm start
3757
env:
3858
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
39-
SCHWAB_PROXY_URL: ${{ secrets.SCHWAB_PROXY_URL }}
4059
SCHWAB_USERNAME: ${{ secrets.SCHWAB_USERNAME }}
4160
SCHWAB_PASSWORD: ${{ secrets.SCHWAB_PASSWORD }}
4261
SCHWAB_TOTP_SECRET: ${{ secrets.SCHWAB_TOTP_SECRET }}

0 commit comments

Comments
 (0)