Skip to content

Commit

Permalink
Update portCreateRepo.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hadar-co authored Oct 10, 2023
1 parent 2d1fc7a commit 7494447
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions .github/workflows/portCreateRepo.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
name: Port demo action
# portCreateRepo.yaml

name: Port action - create repository
on:
workflow_dispatch:
inputs:
name:
type: string
port_payload:
required: true
description: Port's payload, including details for who triggered the action and general context (blueprint, run id, etc...)
description: Port's payload, including details for who triggered the action and general context
type: string
jobs:
create-repository:
runs-on: ubuntu-latest
name: Creating Organization Repository
name: Create repository
steps:
- name: create repo
- name: Create service
uses: octobay/create-repository-action@v1
with:
name: ${{ inputs.name }}
org: 'Port-samples'
access-token: ${{ secrets.ORG_ADMIN_TOKEN }}
private-repo: true
initalize-repo: true
name: ${{ inputs.name }}
org: "<YOUR-ORG-NAME>" # change this to the org name in which you want to create the new repo
access-token: ${{ secrets.ORG_ADMIN_TOKEN }} # the secret we created in the previous step
private-repo: true
initialize-repo: true
create-entity-in-port-and-update-run:
runs-on: ubuntu-latest
steps:
- name: Update service entity in Port # Create an entity in Port for the new service
uses: port-labs/port-github-action@v1
with:
identifier: ${{ inputs.name }}
title: ${{ inputs.name }}
team: "[]"
icon: DefaultBlueprint
blueprint: service
properties: |-
{
"readme": "string",
"url": "https://example.com",
"language": "string"
}
relations: "{}"
clientId: ${{ secrets.PORT_CLIENT_ID }}
clientSecret: ${{ secrets.PORT_CLIENT_SECRET }}
operation: UPSERT
runId: ${{fromJson(inputs.port_payload).context.runId}}
- name: Create a log message # Send action progress/result back to Port
uses: port-labs/port-github-action@v1
with:
clientId: ${{ secrets.PORT_CLIENT_ID }}
clientSecret: ${{ secrets.PORT_CLIENT_SECRET }}
operation: PATCH_RUN
runId: ${{fromJson(inputs.port_payload).context.runId}}
logMessage: New service "${{ inputs.name }}" created successfully 🚀

0 comments on commit 7494447

Please sign in to comment.