Skip to content

Commit fb306be

Browse files
committed
rename SECRET_GITHUB_TOKEN from GITHUB_TOKEN_SECRET
1 parent 3054e89 commit fb306be

6 files changed

Lines changed: 16 additions & 8 deletions

File tree

.changeset/hungry-plants-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ryanatkn/fuz_gitops': minor
3+
---
4+
5+
rename `SECRET_GITHUB_TOKEN` from `GITHUB_TOKEN_SECRET`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ npm i -D @ryanatkn/fuz_gitops
3131
```
3232

3333
- configure [`gitops.config.ts`](/gitops.config.ts)
34-
- fuz_gitops calls the GitHub API using the environment variable `GITHUB_TOKEN_SECRET` for authorization,
34+
- fuz_gitops calls the GitHub API using the environment variable `SECRET_GITHUB_TOKEN` for authorization,
3535
which is a [classic GitHub token](https://github.com/settings/tokens)
3636
(with "public access" for public repos, no options selected)
3737
or a [fine-grainted GitHub token (beta)](https://github.com/settings/tokens?type=beta)

src/lib/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const fetch_github_pull_requests = async (
4141
if (!fetched.ok) {
4242
// TODO @many this is messy but I think it's the main case we need to worry about?
4343
if (fetched.status === 401) {
44-
throw Error('401 response fetching github pull requests - check your GITHUB_TOKEN_SECRET');
44+
throw Error('401 response fetching github pull requests - check your SECRET_GITHUB_TOKEN');
4545
}
4646
return null;
4747
}
@@ -88,7 +88,7 @@ export const fetch_github_check_runs = async (
8888
if (!fetched.ok) {
8989
// TODO @many this is messy but I think it's the main case we need to worry about?
9090
if (fetched.status === 401) {
91-
throw Error('401 response fetching github CI status - check your GITHUB_TOKEN_SECRET');
91+
throw Error('401 response fetching github CI status - check your SECRET_GITHUB_TOKEN');
9292
}
9393
return null;
9494
}

src/lib/gitops.task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export const task: Task<Args> = {
4848
const cache = await create_fs_fetch_value_cache('repos');
4949

5050
// This searches the parent directory for the env var, so we don't use SvelteKit's $env imports
51-
const token = load_from_env('GITHUB_TOKEN_SECRET');
51+
const token = load_from_env('SECRET_GITHUB_TOKEN');
5252
if (!token) {
53-
log.warn('the env var GITHUB_TOKEN_SECRET was not found, so API calls with be unauthorized');
53+
log.warn('the env var SECRET_GITHUB_TOKEN was not found, so API calls with be unauthorized');
5454
}
5555

5656
log.info('fetching remote repo data');

src/lib/gitops_task_helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export const get_gitops_ready = async (
3535

3636
const gitops_config = await import_gitops_config(config_path);
3737

38-
log?.info('resolving gitops config on the filesystem');
38+
log?.info(
39+
`resolving gitops configs on the filesystem in ${repos_dir}`,
40+
gitops_config.repos.map((r) => r.repo_url),
41+
);
3942
const resolved_config = await resolve_gitops_config(gitops_config, repos_dir);
4043

4144
const {resolved_local_repos, unresolved_local_repos} = resolved_config;

src/routes/repos.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,8 @@ export const repos: Repo[] = JSON.parse(
10381038
"@ryanatkn/belt": "^0.25.3",\
10391039
"@ryanatkn/eslint-config": "^0.5.5",\
10401040
"@ryanatkn/fuz": "^0.129.5",\
1041-
"@ryanatkn/gro": "^0.141.1",\
1042-
"@ryanatkn/moss": "^0.18.2",\
1041+
"@ryanatkn/gro": "0.140.0",\
1042+
"@ryanatkn/moss": "0.16.1",\
10431043
"@sveltejs/adapter-static": "^3.0.5",\
10441044
"@sveltejs/kit": "^2.7.2",\
10451045
"@sveltejs/package": "^2.3.6",\

0 commit comments

Comments
 (0)