The Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml tool automates the creation or updating of a catalog.yml
file based on a GitHub repository's metadata. This file, which can be automatically generated and maintained by this tool, serves as the primary input for registering an item to the DataMiner Catalog. By extracting essential metadata from GitHub, such as descriptions, tags, and topics, this tool ensures that catalog entries align with the latest repository information, streamlining the process of catalog registration and maintenance within DataMiner's ecosystem.
- Metadata Extraction: Retrieves essential information (description, tags, repository URL) from GitHub to populate
catalog.yml
. - Type Inference: Detects artifact type from repository naming conventions or GitHub topics.
- Automatic Catalog Updates: Creates or extends
catalog.yml
with up-to-date repository data.
GitHub UI | catalog.yml Field |
Description |
---|---|---|
Repository Name | Title |
Used as the title if no title is set in catalog.yml . |
Description | ShortDescription |
Fetched from the repository’s description, if not provided in catalog.yml . |
Topics | Tags |
GitHub topics are added as tags for the catalog item. |
URL | SourceCodeUrl |
Generated as https://github.com/{owner}/{repo} , if missing in catalog.yml . |
Variable: CATALOGIDENTIFIER |
Id |
If not specified in the existing YAML or as a variable, an identifier is generated automatically for each catalog entry. |
Owners | Owners |
Customizable, with owner email, name, and URL settings. |
This tool not only extends an existing catalog.yml
or manifest.yml
but also generates an auto-generated-catalog.yml
file in the .githubtocatalog
directory. This secondary file is essential because:
- Tracking Catalog IDs: By committing and pushing
auto-generated-catalog.yml
, the tool can create a unique ID on the first run and reuse this ID on future runs. This avoids duplicate catalog records that can occur if new IDs are generated in every workflow run. - Workflow Automation: The
auto-generated-catalog.yml
is maintained separately to allow other processes to retrieve it as needed without modifying the primary catalog file in each update.
The tool can infer the artifact type in two ways:
-
Repository Naming Convention: Follows the GitHub Repository Naming Convention to infer the type from the repository name.
-
GitHub Topic: If the repository does not follow the naming convention, the tool relies on a GitHub topic that corresponds to one of the recognized artifact types.
If neither condition is met, the workflow will fail, and an error will be returned.
- AS:
automationscript
- C:
connector
- CF:
companionfile
- CHATOPS:
chatopsextension
- D:
dashboard
- DISMACRO:
dismacro
- DOC:
documentation
- F:
functiondefinition
- GQIDS:
gqidatasource
oradhocdatasource
- GQIO:
gqioperator
- LSO:
lifecycleserviceorchestration
- PA:
processautomation
- PLS:
profileloadscript
- S:
solution
- SC:
scriptedconnector
- T:
testingsolution
- UDAPI:
userdefinedapi
- V:
visio
- LCA:
lowcodeapp
Ensure you have .NET installed to run the tool.
Install the tool via the terminal:
dotnet tool install -g Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml
Execute the tool using the following command and options:
github-to-catalog-yaml --workspace "/path/to/workspace" --github-token "your_token" --github-repository "owner/repo"
--workspace
(required): Path to wherecatalog.yml
is located or will be created.--github-token
(required): GitHub token (Personal Access Token orsecrets.GITHUB_TOKEN
).--github-repository
(required): GitHub repository name in the formatowner/repo
.--debug
(optional): Enable debug logging for detailed output.
Below is an example workflow for using this tool to automate catalog management in GitHub Actions. Refer to Automation Master SDK Workflow for a complete setup.
auto_generate_catalog_yaml:
name: Auto-Generating Catalog from GitHub
if: inputs.referenceType == 'branch'
runs-on: ubuntu-latest
steps:
- name: Install .NET Tools
run: |
dotnet tool install -g Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml --prerelease
- name: Create or Extend Catalog.yml
run: |
github-to-catalog-yaml --workspace "${{ github.workspace }}" --github-token ${{ secrets.GITHUB_TOKEN }} --github-repository "${{ github.repository }}" --catalog-identifier "${{ vars.catalogIdentifier }}"
- name: Commit .githubtocatalog/auto-generated-catalog
shell: pwsh
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add "${{ github.workspace }}/.githubtocatalog/auto-generated-catalog.yml"
# Check if there are any changes to be committed
git diff --staged --quiet
if ($LASTEXITCODE -ne 0) {
git commit -m "auto-generated"
}
else {
Write-Host "No changes to commit."
}
- name: Push .githubtocatalog/auto-generated-catalog
run: |
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This workflow installs the Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml tool, generates or extends the catalog.yml
, and pushes any updates in .githubtocatalog/auto-generated-catalog.yml
to avoid duplicate catalog entries.