-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: remove binary from source and add it to Docker file * fix: add documentation on readme
- Loading branch information
Showing
6 changed files
with
135 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
FROM node:20 | ||
|
||
RUN curl -sLo ejson.tar.gz https://github.com/Shopify/ejson/releases/download/v1.4.1/ejson_1.4.1_linux_amd64.tar.gz && \ | ||
tar xfvz ejson.tar.gz && \ | ||
mv ejson /usr/local/bin/ && \ | ||
chmod +x /usr/local/bin/ejson && \ | ||
rm ejson.tar.gz | ||
|
||
RUN mkdir -p /opt/ejson/keys | ||
|
||
COPY . /action | ||
WORKDIR /action | ||
|
||
RUN chmod +x ejson-1.4.1 | ||
|
||
RUN npm install --production | ||
|
||
ENTRYPOINT ["node", "/action/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,59 @@ | ||
# ejson-action | ||
|
||
Simple github action that helps to execute encryption and decryption of json files using the ejson cli | ||
Simple github action that helps to execute encryption and decryption of json files using the ejson cli. **Current ejson version 1.4.1**. | ||
|
||
## Configuration | ||
|
||
```yaml | ||
- name: ejson action | ||
uses: Drafteame/ejson-action@main | ||
with: | ||
action: decrypt # [encrypt, decrypt] | ||
file_path: <path-to-ejson-file> | ||
private_key: <private-key-string> # needed if encrypt is used as action | ||
|
||
``` | ||
|
||
### Outputs | ||
|
||
| Output | Description | | ||
|------------|---------------------------------------------------| | ||
| **decrypted** | Decrypted content of the file when the action is performed with the `decrypt` action | | ||
|
||
## Usage | ||
|
||
```yaml | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Decrypt file | ||
uses: Drafteame/ejson-action@main | ||
id: decrypt | ||
with: | ||
action: decrypt | ||
file_path: <path-to-ejson-file> | ||
private_key: <private-key-string> | ||
|
||
- name: Decrypted content | ||
run: | | ||
echo "Decrypted:" | ||
echo "${{ steps.decrypt.outputs.decrypted }}" | ||
- name: Encrypt file | ||
uses: Drafteame/ejson-action@main | ||
id: encrypt | ||
with: | ||
action: encrypt | ||
file_path: <path-to-ejson-file> | ||
private_key: <private-key-string> | ||
|
||
- name: Encrypted content | ||
run: | | ||
echo "Encrypted content:" | ||
cat <path-to-ejson-file> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters