Skip to content

Commit

Permalink
refactor: remove promises and use callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
danteay committed Aug 15, 2024
1 parent cc47d4e commit f4d8811
Show file tree
Hide file tree
Showing 6 changed files with 894 additions and 87 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ jobs:
run: npm run lint

# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Install NodeJS
# uses: actions/setup-node@v3
# with:
# node-version: "20"

# - name: Install dependencies
# run: npm install

# - name: Execute tests
# run: npm run test
# name: Test
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Install NodeJS
# uses: actions/setup-node@v3
# with:
# node-version: "20"

# - name: Install dependencies
# run: npm install

# - name: Execute tests
# run: npm run test

commit_lint:
runs-on: ubuntu-latest
Expand Down
72 changes: 35 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ 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.

ejson_version: "1.5.2" # Specify the ejson version (optional). Defaults to 'latest' if left empty.
```
### Outputs
| Output | Description |
|------------|---------------------------------------------------|
| **decrypted** | Decrypted content of the file when the action is performed with the `decrypt` action |
| Output | Description |
| ------------- | ------------------------------------------------------------------------------------ |
| **decrypted** | Decrypted content of the file when the action is performed with the `decrypt` action |

## Usage

Expand All @@ -30,41 +29,40 @@ jobs:
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>
out_file: <path-to-json-file>
ejson_version: 'latest'
- name: Checkout Repository
uses: actions/checkout@v4
- name: Decrypted content
run: |
echo "Decrypted:"
echo '${{ steps.decrypt.outputs.decrypted }}'
echo
echo
- name: Decrypt file
uses: Drafteame/ejson-action@main
id: decrypt
with:
action: decrypt
file_path: <path-to-ejson-file>
private_key: <private-key-string>
out_file: <path-to-json-file>
ejson_version: "latest"
echo "Stored File:"
cat <path-to-json-file>
echo
- name: Decrypted content
run: |
echo "Decrypted:"
echo '${{ steps.decrypt.outputs.decrypted }}'
echo
echo
- name: Encrypt file
uses: Drafteame/ejson-action@main
id: encrypt
with:
action: encrypt
file_path: <path-to-ejson-file>
ejson_version: 'latest'
echo "Stored File:"
cat <path-to-json-file>
echo
- name: Encrypt file
uses: Drafteame/ejson-action@main
id: encrypt
with:
action: encrypt
file_path: <path-to-ejson-file>
ejson_version: "latest"
- name: Encrypted content
run: |
echo "Encrypted content:"
cat <path-to-ejson-file>
- name: Encrypted content
run: |
echo "Encrypted content:"
cat <path-to-ejson-file>
```
Loading

0 comments on commit f4d8811

Please sign in to comment.