Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hashicorp/actions-generate-metadata
A GitHub action for generating metadata for CRT
https://github.com/hashicorp/actions-generate-metadata
crt
Last synced: 3 months ago
JSON representation
A GitHub action for generating metadata for CRT
- Host: GitHub
- URL: https://github.com/hashicorp/actions-generate-metadata
- Owner: hashicorp
- License: mpl-2.0
- Created: 2021-09-29T16:09:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T02:26:44.000Z (3 months ago)
- Last Synced: 2024-10-03T07:04:00.171Z (3 months ago)
- Topics: crt
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 4
- Watchers: 9
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# generate-metadata action
This action creates JSON file containing metadata information.
## Example of the generated metadata.json file
```json
{
"repository": "consul-terraform-sync",
"repositoryOwner": "hashicorp",
"sha": "4671a6594f2a2650f066489a4fbfe35c3b1e3d35",
"version": "1.0.3",
"buildWorkflowId": "1284662138"
"product": "consul",
"branch": "main",}
```## Usage
See [action.yaml](https://github.com/hashicorp/actions-generate-metadata/blob/main/action.yml)
### Basic usage example
```yaml
- name: Generate metadata file
uses: hashicorp/actions-generate-metadata@main
id: execute
with:
repository: consul-terraform-sync
version: 1.2.3
```### Usage example to create metadata.json file using command in the version input
```yaml
- name: Generate metadata file
uses: hashicorp/actions-generate-metadata@main
id: execute
with:
repository: consul-terraform-sync
version: make version
metadataFileName: metadata.json
```## Inputs
* **`repository`** - (required). The repository name for collecting the metadata
* **`version`** - (required). Indicates the version to be set in the metadata file. Can also accept the command which will set the version (e.g "make version")** **`branch`** - (optional). Github Branch of changes
* **`filePath`** - (optional). Existing path that denotes the location of the metadata file to be created. The action will not create specified directory if it not exist. Default is set to Github action root path.
* **`product`** - (optional). The product binary name
* **`repositoryOwner`** - (optional). The repository owner (organization or user). Default is set to "hashicorp" organization
* **`metadataFileName`** - (optional). The name of the file produced by the action. The generated file will have a JSON format. Default is set to "metadata.json"*Example command for the `version` input is provided [here](https://github.com/hashicorp/actions-generate-metadata#create-metadatajson-file-using-command-in-the-version-input)
## Outputs
* `filepath` - The path where `metadataFileName` was created after action finished executing.