From b8d306bf0fb540ae46ac34e51c16d5e8adbae792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darko=20Kri=C5=BEi=C4=87?= Date: Sat, 2 Mar 2024 23:07:43 +0100 Subject: [PATCH] Some more bla --- README.md | 69 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 007fcfc..06b947e 100644 --- a/README.md +++ b/README.md @@ -31,34 +31,8 @@ See [EXAMPLE.md](EXAMPLE.md) for a full example. ## Requirements: * A GitHub repository or a GitHub organization -* A GitHub Personal Access Token (PAT) -* Go 1.22 or later - -### Compile the code - -```shell -go buid main.go -o deployment-overview -``` - -### Run the code - -```shell -./deployment-overview --github-token --organization --repositories , --target-repository --target-repository-file -``` - -## Parrameters - -| Paramter | Environment | Required | Default | Example | Description | -| --- | --- |-------|--------------------------|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------| -| --github-token | GITHUB_TOKEN | true | - | - | The GitHub Personal Access Token (PAT) | -| --environments | ENVIRONMENTS | true | - | dev,staging,prod | Environments to query. Comma separated list. | -| --organization | ORGANIZATION | true | - | myorga | The GitHub Organization to query for repositories. | -| --repositories | REPOSITORIES | true | - | frontend,backend | Repositories to query. Comma separated list. | -| --verbose | VERBOSE | false | 1 | 0 | Verbosity level, 0=info, 1=debug. Overrides the environment variable VERBOSE. | -| --environment-links | ENVIRONMENT_LINKS | false | - | https://dev.example.com,https://staging.example.com,https://www.example.com | Links to the environments. Comma separated list. | -| --template-file | TEMPLATE_FILE | false | - | template/default.md | The template file to use. | -| --target-json-file | TARGET_JSON_FILE | false | deployment-overview.json | - | The target file to write the result to as JSON. | -| --target-md-file | TARGET_MD_FILE | false | deployment-overview.md | - | The target file to write the result to as Markdown. | +* A GitHub Personal Access Token (PAT), see below +* If using multiple repositories (that is what this action is designed for), the environments of the repositories should be the same like "dev", "staging" and "production". ## Use as GitHub Action @@ -89,15 +63,25 @@ jobs: - name: Deployment overview uses: prodyna/deployment-overview@v0.3 with: + # The organization to query organization: prodyna-yasm + # A comma separated list of repositories to query repositories: yasm-backend,yasm-frontend,yasmctl,yasm-proxy-odbc,yasm-integration,yasm-geocoding,yasm-data,yasm-gotenberg + # The comma separated list of environments that every repository should have environments: dev,staging,prod + # A comma separated list of links to the environments environment-links: https://dev-yasm.prodyna.com,https://staging-yasm.prodyna.com,https://yasm.prodyna.com + # 0=info, 1=debug verbose: 1 + # The GitHub Personal Access Token (PAT) github-token: ${{ secrets.OVERVIEW_GITHUB_TOKEN }} + # The title for the status page title: "YASM Deployment Overview" + # The target json file that is written target-json-File: profile/deployment-overview.json + # The target md file that is written target-md-ile: profile/README.md + # template-file: set only if you have an own one, otherwise remove this entry to take the default one template-file: template/default.md # Push the generated files @@ -110,6 +94,35 @@ jobs: ``` Note that you have to use a GitHub Personal Access Token (PAT) as a secret. +## Use as a standalone tool + +This action is basically a Go CLI tool that can be run as a standalone tool, this is espcially useful when developing the action. + +```shell +go buid main.go -o deployment-overview +``` + +### Run the code + + +```shell +./deployment-overview --github-token --organization --repositories , --target-repository --target-repository-file +``` + +### Parameters + +| Paramter | Environment | Required | Default | Example | Description | +| --- | --- |-------|--------------------------|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------| +| --github-token | GITHUB_TOKEN | true | - | - | The GitHub Personal Access Token (PAT) | +| --environments | ENVIRONMENTS | true | - | dev,staging,prod | Environments to query. Comma separated list. | +| --organization | ORGANIZATION | true | - | myorga | The GitHub Organization to query for repositories. | +| --repositories | REPOSITORIES | true | - | frontend,backend | Repositories to query. Comma separated list. | +| --verbose | VERBOSE | false | 1 | 0 | Verbosity level, 0=info, 1=debug. Overrides the environment variable VERBOSE. | +| --environment-links | ENVIRONMENT_LINKS | false | - | https://dev.example.com,https://staging.example.com,https://www.example.com | Links to the environments. Comma separated list. | +| --template-file | TEMPLATE_FILE | false | - | template/default.md | The template file to use. | +| --target-json-file | TARGET_JSON_FILE | false | deployment-overview.json | - | The target file to write the result to as JSON. | +| --target-md-file | TARGET_MD_FILE | false | deployment-overview.md | - | The target file to write the result to as Markdown. | + ## Required PAT permissions The PAT should be a Fine Grain PAT that belongs to the target organization and has the following permissions: