Merge pull request #7 from rogsme/add-github-action

Add GitHub action
This commit is contained in:
Roger Gonzalez 2024-02-20 12:42:45 -03:00 committed by GitHub
commit f69a3e31ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 4 deletions

25
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
tags: rogsme/bitwarden-to-keepass:latest

View File

@ -7,7 +7,7 @@ This repository is a fork of [davidnemec/bitwarden-to-keepass](https://github.co
They did all of the work, I just added the custom URL functionality and created a Docker repository. All props to [davidnemec](https://github.com/davidnemec/)! They did all of the work, I just added the custom URL functionality and created a Docker repository. All props to [davidnemec](https://github.com/davidnemec/)!
## How it works? ## How does it works?
It uses the official [bitwarden-cli](https://bitwarden.com/help/article/cli/) client to export your items from the Bitwarden vault and move them into your KeePass database - that includes logins (with TOTP seeds, URIs, custom fields, attachments, notes) and secure notes. It uses the official [bitwarden-cli](https://bitwarden.com/help/article/cli/) client to export your items from the Bitwarden vault and move them into your KeePass database - that includes logins (with TOTP seeds, URIs, custom fields, attachments, notes) and secure notes.
## Usage ## Usage
@ -72,8 +72,8 @@ In the end, the script will lock your vault and log out of your account:
``` sh ``` sh
Your vault is locked. Your vault is locked.
KeePass file /exports/my-cool-bitwarden-backup.kdbx generated successfully
You have logged out. You have logged out.
KeePass file /exports/my-cool-bitwarden-backup.kdbx generated successfully
``` ```
And you can find your file in your mounted directory! And you can find your file in your mounted directory!

View File

@ -38,7 +38,7 @@ echo "Generating KeePass file $DATABASE_PATH"
python3 bitwarden-to-keepass.py || { echo "Failed to convert to KeePass"; exit 1; } python3 bitwarden-to-keepass.py || { echo "Failed to convert to KeePass"; exit 1; }
bw lock bw lock
echo "KeePass file $DATABASE_PATH generated successfully"
# Log out of Bitwarden # Log out of Bitwarden
bw logout bw logout
echo "KeePass file $DATABASE_PATH generated successfully"