Skip to content

Commit 4c32ecb

Browse files
committed
refactor: Rename GITHUB_TOKEN to GITHUB_TOKEN_STARGAZERS
1 parent abaac59 commit 4c32ecb

18 files changed

Lines changed: 25 additions & 26 deletions

.envrc-example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use flake .
22
watch_file ./rust-toolchain.toml ./flake.nix
33

4-
export GITHUB_TOKEN="..."
4+
export GITHUB_TOKEN_STARGAZERS="..."
55
export GITHUB_WEBHOOK_SECRET="..."
66
export OPENAI_API_KEY="..."
77
export OPENAI_API_BASE_URL="https://api.openai.com"
@@ -11,7 +11,7 @@ export TURSO_LOCATION="[yourdb].turso.io"
1111
export TEST_OPENAI_API_KEY="..."
1212
export TEST_TURSO_TOKEN="..."
1313
export TEST_TURSO_LOCATION="..."
14-
export TEST_GITHUB_TOKEN="..."
14+
export TEST_GITHUB_TOKEN_STARGAZERS="..."
1515
export TEST_GITHUB_LOGIN="..."
1616
export TEST_GITHUB_REPO="..."
1717

.github/workflows/check-test-e2e.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Verify obelisk-local.toml
4848
env:
49-
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
49+
GITHUB_TOKEN_STARGAZERS: ${{ secrets.E2E_GITHUB_TOKEN }}
5050
TEST_GITHUB_LOGIN: ${{ secrets.TEST_GITHUB_LOGIN }}
5151
TURSO_TOKEN: ${{ secrets.E2E_TURSO_TOKEN }}
5252
TURSO_LOCATION: ${{ secrets.E2E_TURSO_LOCATION }}
@@ -55,7 +55,7 @@ jobs:
5555
5656
- name: Verify obelisk-oci.toml
5757
env:
58-
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
58+
GITHUB_TOKEN_STARGAZERS: ${{ secrets.E2E_GITHUB_TOKEN }}
5959
TEST_GITHUB_LOGIN: ${{ secrets.TEST_GITHUB_LOGIN }}
6060
TURSO_TOKEN: ${{ secrets.E2E_TURSO_TOKEN }}
6161
TURSO_LOCATION: ${{ secrets.E2E_TURSO_LOCATION }}
@@ -67,7 +67,7 @@ jobs:
6767

6868
- name: Verify obelisk-local-js-all.toml
6969
env:
70-
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
70+
GITHUB_TOKEN_STARGAZERS: ${{ secrets.E2E_GITHUB_TOKEN }}
7171
TEST_GITHUB_LOGIN: ${{ secrets.TEST_GITHUB_LOGIN }}
7272
TURSO_TOKEN: ${{ secrets.E2E_TURSO_TOKEN }}
7373
TURSO_LOCATION: ${{ secrets.E2E_TURSO_LOCATION }}
@@ -79,7 +79,7 @@ jobs:
7979

8080
- name: Verify obelisk-local-go-all.toml
8181
env:
82-
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
82+
GITHUB_TOKEN_STARGAZERS: ${{ secrets.E2E_GITHUB_TOKEN }}
8383
TEST_GITHUB_LOGIN: ${{ secrets.TEST_GITHUB_LOGIN }}
8484
TURSO_TOKEN: ${{ secrets.E2E_TURSO_TOKEN }}
8585
TURSO_LOCATION: ${{ secrets.E2E_TURSO_LOCATION }}

.github/workflows/check-test-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Run integration tests
4545
env:
4646
CI: true
47-
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
47+
TEST_GITHUB_TOKEN_STARGAZERS: ${{ secrets.TEST_GITHUB_TOKEN }}
4848
TEST_GITHUB_LOGIN: ${{ secrets.TEST_GITHUB_LOGIN }}
4949
TEST_GITHUB_REPO: ${{ secrets.TEST_GITHUB_REPO }}
5050
TEST_TURSO_TOKEN: ${{ secrets.TEST_TURSO_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Here is the complete [workflow source](./workflow/stargazers/workflow-rs/src/lib
3333
### Setting up the external services
3434
The activities require folowing values to be present as environment variables:
3535
```sh
36-
export GITHUB_TOKEN="..."
36+
export GITHUB_TOKEN_STARGAZERS="..."
3737
export OPENAI_API_KEY="..."
3838
export TURSO_TOKEN="..."
3939
export GITHUB_WEBHOOK_SECRET="some-secret"

activity/github/impl/.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
target = "wasm32-wasip2"
33

44
[target.wasm32-wasip2]
5-
runner = "wasmtime run -Scli -Shttp --env TEST_GITHUB_TOKEN --env TEST_GITHUB_LOGIN --env TEST_GITHUB_REPO --env TEST_GITHUB_STARGAZERS_CURSOR"
5+
runner = "wasmtime run -Scli -Shttp --env TEST_GITHUB_TOKEN_STARGAZERS --env TEST_GITHUB_LOGIN --env TEST_GITHUB_REPO --env TEST_GITHUB_STARGAZERS_CURSOR"

activity/github/impl/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ The `account` interface fetches basic info like repositories, contributions etc.
66

77
## Prerequisites
88
[Classic GitHub token](https://github.com/settings/tokens/) with `read:org` permission is required.
9-
The token must be accesible as `GITHUB_TOKEN` environment variable.
9+
The token must be accesible as `GITHUB_TOKEN_STARGAZERS` environment variable.
1010
```sh
11-
export GITHUB_TOKEN="..."
11+
export GITHUB_TOKEN_STARGAZERS="..."
1212
```
1313

1414
## Running the activity
@@ -32,7 +32,7 @@ cargo nextest run
3232
## Integration testing
3333

3434
```sh
35-
export TEST_GITHUB_TOKEN="..."
35+
export TEST_GITHUB_TOKEN_STARGAZERS="..."
3636
export TEST_GITHUB_LOGIN="..."
3737
export TEST_GITHUB_REPO="..."
3838
# optinally export TEST_GITHUB_STARGAZERS_CURSOR="..."
@@ -62,7 +62,6 @@ echo '
6262
{"query":"'$(echo $QUERY)'", "variables":{"repo":"obeli-sk/obelisk", "page":2}}
6363
' | curl -X POST \
6464
-H "User-Agent: test" \
65-
-H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/graphql \
65+
-H "Authorization: Bearer $GITHUB_TOKEN_STARGAZERS" https://api.github.com/graphql \
6666
-d @-
67-
6867
```

activity/github/impl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use wstd::{
1313
};
1414
mod stargazers;
1515

16-
const ENV_GITHUB_TOKEN: &str = "GITHUB_TOKEN";
16+
const ENV_GITHUB_TOKEN: &str = "GITHUB_TOKEN_STARGAZERS";
1717

1818
mod generated {
1919
#![allow(clippy::empty_line_after_outer_attr)]

obelisk-local-go-activity.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exec.lock_expiry.seconds = 5
1818
pattern = "https://api.github.com"
1919
methods = ["POST"]
2020
[activity_wasm.allowed_host.secrets]
21-
env_vars = ["GITHUB_TOKEN"]
21+
env_vars = ["GITHUB_TOKEN_STARGAZERS"]
2222
replace_in = ["headers"]
2323

2424
[[activity_wasm]]

obelisk-local-go-all.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exec.lock_expiry.seconds = 5
1818
pattern = "https://api.github.com"
1919
methods = ["POST"]
2020
[activity_wasm.allowed_host.secrets]
21-
env_vars = ["GITHUB_TOKEN"]
21+
env_vars = ["GITHUB_TOKEN_STARGAZERS"]
2222
replace_in = ["headers"]
2323

2424
[[activity_wasm]]

obelisk-local-go-webhook.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exec.lock_expiry.seconds = 5
1818
pattern = "https://api.github.com"
1919
methods = ["POST"]
2020
[activity_wasm.allowed_host.secrets]
21-
env_vars = ["GITHUB_TOKEN"]
21+
env_vars = ["GITHUB_TOKEN_STARGAZERS"]
2222
replace_in = ["headers"]
2323

2424
[[activity_wasm]]

0 commit comments

Comments
 (0)