Skip to content

Commit

Permalink
feat: create new ejson_version input and set to latest if is empty (#11)
Browse files Browse the repository at this point in the history
* feat: create new ejson_version input and set to latest if is empty

* chore: save

* fix: correct binary download error

* fix: correct binary download error

* fix: correct binary download error

* fix: correct binary download error using axios

* fix: correct binary download error using axios

* fix: correct binary download error using axiosand targz

* chore: bump dependencies

* refactor: refactor download process

* refactor: refactor download process

* fix: remove dead codes Dockerfiles

* fix: add warning when specified version does not exist

* docs: update README to reflect version parameterization

---------

Co-authored-by: ArielSantos01 <arielg.santos21@gmail.com>
  • Loading branch information
danteay and ArielSantos01 authored Aug 12, 2024
1 parent cddcd74 commit 28a113f
Show file tree
Hide file tree
Showing 7 changed files with 873 additions and 882 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ LABEL "com.github.actions.name"="ejson action"
LABEL "com.github.actions.description"="Execute encryption and decryption of json files using ejson"
LABEL "org.opencontainers.image.source"="https://github.com/Drafteame/ejson-action"

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
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ejson-action

Simple github action that helps to execute encryption and decryption of json files using the ejson cli. **Current ejson version 1.4.1**.
Simple github action that helps to execute encryption and decryption of json files using the ejson cli. **Current ejson version 1.5.2**.

## Configuration

Expand All @@ -12,6 +12,7 @@ Simple github action that helps to execute encryption and decryption of json fil
file_path: <path-to-ejson-file>
private_key: <private-key-string> # needed if encrypt is used as action
out_file: <path-to-json-file> # File where the decrypted content will be stored (optional)
ejson_version: '1.5.2' # Specify the ejson version (optional). Defaults to 'latest' if left empty.

```

Expand Down Expand Up @@ -40,6 +41,7 @@ jobs:
file_path: <path-to-ejson-file>
private_key: <private-key-string>
out_file: <path-to-json-file>
ejson_version: 'latest'

- name: Decrypted content
run: |
Expand All @@ -58,7 +60,8 @@ jobs:
with:
action: encrypt
file_path: <path-to-ejson-file>
private_key: <private-key-string>
ejson_version: 'latest'


- name: Encrypted content
run: |
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ inputs:
out_file:
description: "File path to an out json file that should be use to place the decrypted content of the ejson"
required: false
ejson_version:
description: "Version of the ejson binary to use"
required: false

outputs:
decrypted:
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const main = async () => {
core.getInput("file_path"),
core.getInput("private_key"),
core.getInput("out_file"),
core.getInput("ejson_version"),
);

try {
Expand Down
Loading

0 comments on commit 28a113f

Please sign in to comment.