Skip to content

Commit 0b03378

Browse files
docs: update readme
1 parent c1607b2 commit 0b03378

File tree

1 file changed

+71
-31
lines changed

1 file changed

+71
-31
lines changed

README.md

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# meshStack Register Source Action
22

3-
This GitHub Action registers building block sources and steps with meshStack. It integrates with the meshStack API to set up the structure of a building block run with the specified steps.
3+
This GitHub Action registers building block sources and steps with meshStack. It integrates with the meshStack API to set up the structure of a building block run with the specified steps. This allows platform teams
4+
to provide additional feedback about building block execution to application teams.
45

56
## Overview
67

7-
The meshStack building block pipeline allows you to automate and manage complex workflows by defining a series of steps that need to be executed. Each building block run represents an instance of such a workflow. This GitHub Action helps you register the source of the run and define its steps.
8+
A meshStack building block run allows you to automate and manage complex workflows by defining a series of steps that need to be executed. This GitHub Action helps you register the source of the run and define its steps.
89

9-
In order to return updates for a run to meshStack, you first need to register one or multiple steps and their resources of your run execution. It is up to you how many or how you organize your steps. You can, however, also just send step results back and the registration takes place on the fly. But in order to have a consistent display and ordering of steps, it is highly advised to pre-register steps and sources.
10+
It is up to you how many or how you organize your steps. You can, however, also just send step results back and the registration takes place on the fly. But in order to have a consistent display and ordering of steps, it is highly advised to pre-register all steps that you plan to execute.
1011

1112
## Related Actions
1213

@@ -30,38 +31,77 @@ For more information, refer to the [meshStack documentation on building block in
3031

3132
## Inputs
3233

33-
- `client_id` (required): The client ID for the API.
34-
- `key_secret` (required): The key secret for the API.
35-
- `steps` (required): The steps to register.
34+
- `steps` (required): JSON array of steps to register. Each step should have an `id` and `displayName`.
3635

37-
### Outputs
36+
## Outputs
3837

3938
- `token_file`: Path to the file containing the authentication token
39+
- Dynamic outputs based on building block inputs (e.g., custom parameters defined in your building block)
40+
41+
## Required GitHub Context Parameters
42+
43+
This action requires the meshStack workflow trigger parameters to be present in the GitHub event payload:
44+
45+
- `buildingBlockRunUrl` (required): URL to fetch the building block run object from the meshStack API
46+
- `buildingBlockRun` (optional, legacy): Base64-encoded building block run object (alternative to `buildingBlockRunUrl`)
47+
48+
These parameters are automatically provided by meshStack when it triggers your workflow via `workflow_dispatch`.
4049

4150
## Example Usage
4251

4352
```yaml
44-
- name: Setup meshStack bbrun
45-
id: setup-meshstack-auth
46-
uses: meshcloud/actions-register-source@main
47-
with:
48-
client_id: ${{ vars.BUILDINGBLOCK_API_CLIENT_ID }}
49-
key_secret: ${{ secrets.BUILDINGBLOCK_API_KEY_SECRET }}
50-
steps: |
51-
[
52-
{ "id": "terraform-plan", "displayName": "terraform plan" },
53-
]
54-
55-
- name: Terragrunt plan
56-
id: terraform-plan
57-
run: terraform plan -var="resource_group_name=${{ steps.setup-meshstack-auth.outputs.resource_group_name }}" -out=tfplan
58-
59-
60-
- name: Send status on plan
61-
if: ${{ steps.terraform-plan.outcome == 'success' }}
62-
uses: meshcloud/actions-send-status@main
63-
with:
64-
step_id: "terraform-plan"
65-
status: ${{ steps.terraform-plan.outcome == 'success' && 'SUCCEEDED' || 'FAILED' }}
66-
user_message: ${{ steps.terraform-plan.outcome == 'success' && 'Successful plan Terraform configuration.' || 'Failed to plan Terraform configuration.' }}
67-
system_message: ${{ steps.terraform-plan.outcome == 'success' && 'Successful plan Terraform configuration.' || 'Failed to plan Terraform configuration.' }}```
53+
name: Deploy Building Block
54+
55+
on:
56+
workflow_dispatch:
57+
inputs:
58+
buildingBlockRunUrl:
59+
description: "URL to fetch the Building Block Run Object from"
60+
required: true
61+
62+
jobs:
63+
deploy:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout Code
67+
uses: actions/checkout@v4
68+
69+
- name: Setup meshStack auth
70+
id: setup-meshstack-auth
71+
uses: meshcloud/actions-meshstack-auth@v2
72+
with:
73+
base_url: ${{ vars.MESHSTACK_BASE_URL }}
74+
client_id: ${{ vars.BUILDINGBLOCK_API_CLIENT_ID }}
75+
key_secret: ${{ secrets.BUILDINGBLOCK_API_KEY_SECRET }}
76+
77+
- name: Register building block source
78+
id: register-source
79+
uses: meshcloud/actions-register-source@v2
80+
with:
81+
steps: |
82+
[
83+
{ "id": "terraform-plan", "displayName": "Terraform Plan" },
84+
{ "id": "terraform-apply", "displayName": "Terraform Apply" }
85+
]
86+
87+
- name: Terraform plan
88+
id: terraform-plan
89+
run: terraform plan -var="resource_group_name=${{ steps.register-source.outputs.resource_group_name }}" -out=tfplan
90+
91+
- name: Send status on plan
92+
uses: meshcloud/actions-send-status@v2
93+
with:
94+
step_id: terraform-plan
95+
step_status: SUCCEEDED
96+
97+
- name: Terraform apply
98+
id: terraform-apply
99+
run: terraform apply tfplan
100+
101+
- name: Send status on apply
102+
uses: meshcloud/actions-send-status@v2
103+
with:
104+
step_id: terraform-apply
105+
step_status: SUCCEEDED
106+
107+
```

0 commit comments

Comments
 (0)