Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: enhance Docker usage instructions in README #9

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ jobs:
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.short-sha.outputs.sha }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v2
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: false
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,31 @@ You can also utilise the Docker image without installing the binary executable f
Simply enter the subsequent command or reference the `compose.yaml` file.

```bash
docker run --rm ghcr.io/mingcheng/aigitcommit:latest \
-v .:\repo:ro \
-e OPENAI_API_BASE='<openai api base>' \
-e OPENAI_API_TOKEN='<token>' \
-e OPENAI_MODEL_NAME='<model name>'
docker run \
--rm \
-v $PWD:/repo:ro \
-e OPENAI_API_BASE='<api base>' \
-e OPENAI_API_TOKEN='<api token>' \
-e OPENAI_MODEL_NAME='<model name>' \
-e OPENAI_API_PROXY='<the proxy address if you need>' \
ghcr.io/mingcheng/aigitcommit
```

Notice: If you wish to utilise the `--commit` option, you must ensure that the `/repo` directory is writable.
Notice: If you wish to utilise the `--commit` option, you must ensure that the `/repo` directory is writable:

```bash
docker run \
--rm \
-it \
-v $PWD:/repo:rw \
-e OPENAI_API_BASE='<api base>' \
-e OPENAI_API_TOKEN='<api token>' \
-e OPENAI_MODEL_NAME='<model name>' \
-e OPENAI_API_PROXY='<the proxy address if you need>' \
ghcr.io/mingcheng/aigitcommit --commit
```

Tips: You can add `--yes` options to skip the confirm.

### Git Hook

Expand Down