File tree Expand file tree Collapse file tree 2 files changed +32
-5
lines changed Expand file tree Collapse file tree 2 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 18
18
go-version : ' 1.24.x'
19
19
20
20
- uses : ko-build/setup-ko@v0.8
21
- - run : ko build
21
+
22
+ - run : ko build --bare
Original file line number Diff line number Diff line change 1
1
Monitor GH auth tokens for problems like upcoming expiration
2
2
3
+ # Usage
4
+
3
5
``` console
4
6
$ TOKEN=$( gh auth token) github-token-monitor --token-env-vars TOKEN
5
7
Checking "TOKEN"...
@@ -20,7 +22,31 @@ Error: checks failed for token(s): OLD_TOKEN
20
22
exit status 1
21
23
```
22
24
23
- Also supports pointing to a directory with ` --tokens-dir ` , which can be
24
- convenient when using this as an e.g. Kubernetes CronJob to mount existing
25
- Secrets to be checked. The files in this directory can be either bare tokens
26
- or dockerconfig JSON.
25
+ # Container
26
+
27
+ This repo publishes a lightweight container with
28
+ [ ` ko ` ] ( https://github.com/ko-build/ko ) .
29
+
30
+ ## Github Actions
31
+
32
+ You can check expiration for a token in a Github Actions job directly using the
33
+ container, e.g. for a secret named ` TEST_TOKEN ` :
34
+
35
+ ``` yaml
36
+ jobs :
37
+ test_token_expiration :
38
+ runs-on : ubuntu-latest
39
+ steps :
40
+ - uses : docker://ghcr.io/fermyon/github-token-monitor:latest
41
+ with :
42
+ args : " --token-env-vars TEST_TOKEN"
43
+ env :
44
+ TEST_TOKEN : ${{ secrets.TEST_TOKEN }}
45
+ ` ` `
46
+
47
+ ## Tokens Dir
48
+
49
+ You can point to a directory with ` --tokens-dir`, which can be convenient when
50
+ using this as an e.g. Kubernetes CronJob to mount existing Secrets to be
51
+ checked. All files in the directory will be parsed as either bare tokens or
52
+ dockerconfig JSON.
You can’t perform that action at this time.
0 commit comments