Skip to content

Commit 417559c

Browse files
committed
version 0.0.10
1 parent 092776d commit 417559c

File tree

7 files changed

+40314
-120
lines changed

7 files changed

+40314
-120
lines changed

.github/release.yml .github/workflows/release.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Release
2-
32
on:
43
push:
54
tags:
@@ -27,23 +26,25 @@ jobs:
2726
- name: Bundle with ncc
2827
run: npx ncc build lib/index.js -o dist
2928

30-
- name: Create release
31-
id: create_release
32-
uses: actions/create-release@v1
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Get release ID
30+
id: get_release
31+
uses: actions/github-script@v4
3532
with:
36-
tag_name: ${{ github.ref }}
37-
release_name: Release ${{ github.ref }}
38-
draft: false
39-
prerelease: false
33+
script: |
34+
const release = await github.repos.getReleaseByTag({
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
tag: context.ref.replace('refs/tags/', '')
38+
});
39+
return release.data.id;
40+
result-encoding: string
4041

4142
- name: Upload release asset
4243
uses: actions/upload-release-asset@v1
4344
env:
4445
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4546
with:
46-
upload_url: ${{ steps.create_release.outputs.upload_url }}
47+
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_release.outputs.result }}/assets?name=index.js
4748
asset_path: ./dist/index.js
4849
asset_name: index.js
4950
asset_content_type: application/javascript

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Node.js
22
node_modules/
3-
dist/
43
build/
54

65
# TypeScript

README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Register Source GitHub Action
2+
3+
This GitHub Action registers sources to the meshStack Building Block pipeline workflow. It integrates with the meshStack API to update the status of a Building Block Run with the specified steps.
4+
5+
### Overview
6+
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 update its status with the specified steps.
8+
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+
11+
For more details on the meshBuildingBlockRun API, refer to the [meshcloud API documentation](https://docs.meshcloud.io/api/index.html#mesh_buildingblockrun).
12+
13+
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).
14+
15+
16+
### Inputs
17+
18+
- `base_url` (required): The base URL for the API.
19+
- `bb_run_uuid` (required): The Building Block Run UUID.
20+
- `steps` (required): The steps to register.
21+
- `token` (required): The API token for authentication.
22+
23+
### Outputs
24+
25+
- `response`: The response from the API.
26+
27+
### Example Usage
28+
29+
```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+
```

action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ inputs:
1515
required: true
1616
runs:
1717
using: 'node12'
18-
main: 'lib/index.js'
18+
main: 'dist/index.js'
19+

0 commit comments

Comments
 (0)