Skip to content

Commit f932d05

Browse files
committed
chore: update readme
1 parent ee9ecc3 commit f932d05

File tree

3 files changed

+35
-52
lines changed

3 files changed

+35
-52
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Node.js
1616
uses: actions/setup-node@v2
1717
with:
18-
node-version: '14'
18+
node-version: '20'
1919

2020
- name: Install dependencies
2121
run: npm install

.github/workflows/test.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ jobs:
1111
id: setup-meshstack-auth
1212
uses: ./
1313
with:
14-
base_url: 'https://federation.dev.meshcloud.io'
15-
bb_run_uuid: 'c087f5e4-f494-437c-9162-27d7467e3fba'
1614
steps: |
1715
[
1816
{ "id": "terraform-validate", "displayName": "terraform validate" },
@@ -21,21 +19,3 @@ jobs:
2119
]
2220
client_id: ${{ secrets.CLIENT_ID }}
2321
key_secret: ${{ secrets.KEY_SECRET }}
24-
25-
# - name: Read token from file
26-
# id: read-token
27-
# run: |
28-
# token=$(cat ${{ steps.setup-meshstack-auth.outputs.token_file }} | jq -r .token)
29-
# echo "MESHSTACK_API_TOKEN=$token" >> $GITHUB_ENV
30-
31-
# - name: Send status
32-
# uses: meshcloud/[email protected]
33-
# with:
34-
# base_url: 'https://example.com'
35-
# bb_run_uuid: 'example-uuid'
36-
# step_id: "terraform-validate"
37-
# status: 'SUCCEEDED'
38-
# token: ${{ env.MESHSTACK_API_TOKEN }}
39-
# user_message: 'Successful validate Terraform configuration.'
40-
# system_message: 'Successful validate Terraform configuration.'
41-
#

README.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,48 @@ For more details on the meshBuildingBlockRun API, refer to the [meshcloud API do
1212

1313
For more information on integrating with the meshStack Building Block pipeline, refer to the [meshStack Building Block pipeline integration documentation](https://docs.meshcloud.io/docs/meshstack.building-pipeline-integration.html#building-block-run-and-steps).
1414

15+
### Building Block Inputs:
16+
17+
When MeshStack triggers your pipeline, it sends a GitHub Actions event containing the URL, building block ID, and all the inputs your building block needs. These inputs are written to `GITHUB_OUTPUT`. You can use these inputs in your pipeline with the syntax `${{ steps.setup-meshstack-auth.outputs.your_input_from_meshstack_bb }}`.
18+
19+
For more information, refer to the [MeshStack documentation on building block inputs](https://docs.meshcloud.io/docs/administration.building-blocks.html#building-block-inputs).
1520

1621
### Inputs
1722

18-
- `base_url` (required): The base URL for the API.
19-
- `bb_run_uuid` (required): The Building Block Run UUID.
23+
- `` (required): The base URL for the API.
24+
- `client_id` (required): The client ID for the API.
25+
- `key_secret` (required): The key secret for the API.
2026
- `steps` (required): The steps to register.
21-
- `token` (required): The API token for authentication.
2227

2328
### Outputs
2429

25-
- `response`: The response from the API.
30+
- `token_file`: Path to the file containing the authentication token
31+
2632

2733
### Example Usage
2834

2935
```yaml
30-
name: Register Source Example
31-
on:
32-
push:
33-
branches:
34-
- main
35-
36-
jobs:
37-
register-source:
38-
runs-on: ubuntu-latest
39-
40-
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
43-
44-
- name: Register Source
45-
uses: meshcloud/[email protected]
46-
with:
47-
base_url: 'https://api.example.com'
48-
bb_run_uuid: 'your-bb-run-uuid'
49-
token: ${{ secrets.API_TOKEN }}
50-
steps: |
51-
[
52-
{ "id": "terraform-validate", "displayName": "terraform validate" },
53-
{ "id": "terraform-plan", "displayName": "terraform plan" },
54-
{ "id": "terraform-apply", "displayName": "terraform apply" }
55-
]
56-
```
36+
- name: Setup meshStack bbrun
37+
id: setup-meshstack-auth
38+
uses: meshcloud/actions-register-source@main
39+
with:
40+
client_id: ${{ vars.BUILDINGBLOCK_API_CLIENT_ID }}
41+
key_secret: ${{ secrets.BUILDINGBLOCK_API_KEY_SECRET }}
42+
steps: |
43+
[
44+
{ "id": "terraform-plan", "displayName": "terraform plan" },
45+
]
46+
47+
- name: Terragrunt plan
48+
id: terraform-plan
49+
run: terraform plan -var="resource_group_name=${{ steps.setup-meshstack-auth.outputs.resource_group_name }}" -out=tfplan
50+
51+
52+
- name: Send status on plan
53+
if: ${{ steps.terraform-plan.outcome == 'success' }}
54+
uses: meshcloud/actions-send-status@main
55+
with:
56+
step_id: "terraform-plan"
57+
status: ${{ steps.terraform-plan.outcome == 'success' && 'SUCCEEDED' || 'FAILED' }}
58+
user_message: ${{ steps.terraform-plan.outcome == 'success' && 'Successful plan Terraform configuration.' || 'Failed to plan Terraform configuration.' }}
59+
system_message: ${{ steps.terraform-plan.outcome == 'success' && 'Successful plan Terraform configuration.' || 'Failed to plan Terraform configuration.' }}```

0 commit comments

Comments
 (0)