Skip to content

Commit

Permalink
Merge branch 'add-cwd'
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfrank-crabnebula committed Mar 28, 2024
2 parents 8561c69 + a4b3209 commit 5916ced
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This action wraps the CrabNebula Cloud CLI to be used as a GitHub Action.

The documentation for the CrabNebula Cloud can be found [here](https://docs.crabnebula.dev/). It includes information on [how to install the CLI](https://docs.crabnebula.dev/cloud/cli/) and how to use it as well as [example workflows](https://docs.crabnebula.dev/cloud/continuous-integration/) for this action.

## Example

```yml
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
api-key:
description: 'API key with write permissions for CrabNebula Cloud'
required: true
path:
description: 'Optional path to run the CLI in, needs to be a valid directory path (Unix syntax)'
required: false
default: '.'

outputs:
stdout:
Expand All @@ -15,19 +19,20 @@ outputs:

runs:
using: 'composite'

steps:
- name: Download CLI (unix)
shell: bash
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
cd ${{ inputs.path }}
curl -L https://cdn.crabnebula.app/download/01HKMY6ZXJA3P0QHA5GQY8KKRT/latest/cn_${{ runner.os == 'Linux' && 'linux' || 'macos' }} --output cn
chmod +x cn
- name: Download CLI (Windows)
shell: bash
if: runner.os == 'Windows'
run: |
cd ${{ inputs.path }}
curl -L https://cdn.crabnebula.app/download/01HKMY6ZXJA3P0QHA5GQY8KKRT/latest/cn_windows.exe --output cn
- name: "Run Command"
Expand All @@ -36,6 +41,7 @@ runs:
env:
CN_API_KEY: ${{ inputs.api-key }}
run: |
cd ${{ inputs.path }}
OUTPUT=$(./cn ${{ inputs.command }})
echo "stdout<<nEOFn" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 5916ced

Please sign in to comment.