Skip to content

Commit 8321498

Browse files
authored
Merge pull request #9 from mingcheng/develop
docs: enhance Docker usage instructions in README
2 parents cb63ff7 + 38767ac commit 8321498

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

.github/workflows/ghcr.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
4949
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.short-sha.outputs.sha }}
5050
labels: ${{ steps.meta.outputs.labels }}
51-
# - name: Generate artifact attestation
52-
# uses: actions/attest-build-provenance@v2
53-
# with:
54-
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
55-
# subject-digest: ${{ steps.push.outputs.digest }}
56-
# push-to-registry: true
51+
- name: Generate artifact attestation
52+
uses: actions/attest-build-provenance@v2
53+
with:
54+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
55+
subject-digest: ${{ steps.push.outputs.digest }}
56+
push-to-registry: false

README.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,31 @@ You can also utilise the Docker image without installing the binary executable f
6666
Simply enter the subsequent command or reference the `compose.yaml` file.
6767

6868
```bash
69-
docker run --rm ghcr.io/mingcheng/aigitcommit:latest \
70-
-v .:\repo:ro \
71-
-e OPENAI_API_BASE='<openai api base>' \
72-
-e OPENAI_API_TOKEN='<token>' \
73-
-e OPENAI_MODEL_NAME='<model name>'
69+
docker run \
70+
--rm \
71+
-v $PWD:/repo:ro \
72+
-e OPENAI_API_BASE='<api base>' \
73+
-e OPENAI_API_TOKEN='<api token>' \
74+
-e OPENAI_MODEL_NAME='<model name>' \
75+
-e OPENAI_API_PROXY='<the proxy address if you need>' \
76+
ghcr.io/mingcheng/aigitcommit
7477
```
7578

76-
Notice: If you wish to utilise the `--commit` option, you must ensure that the `/repo` directory is writable.
79+
Notice: If you wish to utilise the `--commit` option, you must ensure that the `/repo` directory is writable:
80+
81+
```bash
82+
docker run \
83+
--rm \
84+
-it \
85+
-v $PWD:/repo:rw \
86+
-e OPENAI_API_BASE='<api base>' \
87+
-e OPENAI_API_TOKEN='<api token>' \
88+
-e OPENAI_MODEL_NAME='<model name>' \
89+
-e OPENAI_API_PROXY='<the proxy address if you need>' \
90+
ghcr.io/mingcheng/aigitcommit --commit
91+
```
92+
93+
Tips: You can add `--yes` options to skip the confirm.
7794

7895
### Git Hook
7996

0 commit comments

Comments
 (0)