Skip to content

Commit

Permalink
Merge pull request #5 from livecycle/eliyabar-change-preevy-up-input
Browse files Browse the repository at this point in the history
change-preevy-up-input
  • Loading branch information
eliyabar authored Jul 18, 2023
2 parents 2063f90 + 2eb1a7d commit a8d68ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
id: preevy
with:
profile-url: "s3://preevy-12345678-my-profile?region=eu-west-1"
docker-compose-yaml-path: "./docker/docker-compose.yaml"
docker-compose-yaml-paths: [./docker/docker-compose.yaml]
- uses: mshick/add-pr-comment@v2
with:
message: ${{ steps.preevy.outputs.urls-markdown }}
```
```
11 changes: 6 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ inputs:
args:
required: false
description: "Additional args to provide to the `up` command."
docker-compose-yaml-path:
docker-compose-yaml-paths:
required: false
description: "The path to the docker compose file. Uses current working directory if not provided."
description: "Array of comma separated paths to docker compose files. Uses current working directory if not provided."
outputs:
urls-markdown:
description: "The generated URLs of the preview environments create by Preevy, formatted as a markdown table"
Expand All @@ -40,13 +40,14 @@ runs:
id: run_preevy
run: |
# Convert the docker-compose-yaml-path input to an env var
compose_file_path="${{ inputs.docker-compose-yaml-path }}"
compose_file_path=${{ join(inputs.docker-compose-yaml-paths, '-f ') }}
compose_file_path_or_default=${compose_file_path:+-f ${compose_file_path}}
# Run the up command
preevy up ${compose_file_path:+-f ${compose_file_path}} ${{ inputs.args }}
preevy up ${compose_file_path_or_default} ${{ inputs.args }}
# Fetch the generated preevy urls
urls_json="$(preevy urls ${compose_file_path:+-f ${compose_file_path}} --json)"
urls_json="$(preevy urls ${compose_file_path_or_default} --json)"
# Format urls into a markdown table and store them in urls.txt
cat << EOF > urls.txt
Expand Down

0 comments on commit a8d68ec

Please sign in to comment.