Skip to content

Commit d7e90db

Browse files
committed
Update container
1 parent cd578fb commit d7e90db

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
go-version: '1.24.x'
1919

2020
- uses: ko-build/setup-ko@v0.8
21-
- run: ko build
21+
22+
- run: ko build --bare

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Monitor GH auth tokens for problems like upcoming expiration
22

3+
# Usage
4+
35
```console
46
$ TOKEN=$(gh auth token) github-token-monitor --token-env-vars TOKEN
57
Checking "TOKEN"...
@@ -20,7 +22,31 @@ Error: checks failed for token(s): OLD_TOKEN
2022
exit status 1
2123
```
2224

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.

0 commit comments

Comments
 (0)