Skip to content

Commit

Permalink
Add extra parameter to allow preventing this step from reporting in P…
Browse files Browse the repository at this point in the history
…ort (#1)

* Enhance action with createPortEntity parameter

* Improve logging to represent what actually happened
  • Loading branch information
nedyalkov authored Oct 23, 2023
1 parent c305b61 commit 6542ab6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ In addition, as cookiecutter is an Open Source project you can make your own pro
| monorepoUrl | If using scaffolding within a monorepo specify the URL here | Yes | |
| scaffoldDirectory | Root folder to scaffold when using monorepo | Yes | |
| githubURL | GitHub url for self hosted version | Yes |https://api.github.com|
| createPortEntity | Whether should create port entity with the action or not. You can set this to `false` if you'd like to create the entry yourself with `port-labs/port-github-action` | No | true |

## Quickstart - Scaffold Golang Template

Expand Down
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ inputs:
templateDirectory:
description: 'The directory to scaffold the cookiecutter template from'
required: false
createPortEntity:
description: 'Whether to create a Port entity for the repository'
required: false
default: "true"
runs:
using: docker
image: Dockerfile
11 changes: 8 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ template_directory="$INPUT_TEMPLATEDIRECTORY"
port_user_inputs="$INPUT_PORTUSERINPUTS"
monorepo_url="$INPUT_MONOREPOURL"
scaffold_directory="$INPUT_SCAFFOLDDIRECTORY"
create_port_entity="$INPUT_CREATEPORTENTITY"
branch_name="port_$port_run_id"
git_url="$INPUT_GITHUBURL"

Expand Down Expand Up @@ -171,9 +172,13 @@ main() {

url="https://github.com/$org_name/$repository_name"

send_log "Reporting to Port the new entity created 🚢"

report_to_port
if [[ "$create_port_entity" == "true" ]]
then
send_log "Reporting to Port the new entity created 🚢"
report_to_port
else
send_log "Skipping reporting to Port the new entity created 🚢"
fi

if [ -n "$monorepo_url" ] && [ -n "$scaffold_directory" ]; then
send_log "Finished! 🏁✅"
Expand Down

0 comments on commit 6542ab6

Please sign in to comment.