From 4e1d0c2d2fb75a3e686eb9afa4c33e0c14ed39d7 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Sun, 8 Dec 2019 16:01:22 -0500 Subject: [PATCH 1/4] Update example workflow Signed-off-by: Scott Rigby --- README.md | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f85a7b3..9c01701 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,61 @@ # Chart releaser action -A GitHub action to turn a GitHub repo into a self-hosted Helm chart repo, using [helm/chart-releaser](https://github.com/helm/chart-releaser) CLI tool. +A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, using [helm/chart-releaser](https://github.com/helm/chart-releaser) CLI tool. ## Usage ### Pre-requisites 1. A GitHub repo containing a directory with your Helm charts (eg: `/charts`) -1. A GitHub token -1. Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file). +1. A GitHub project [Secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets) named `CR_TOKEN` with the value of a GitHub [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line#creating-a-token) + * The token must have `repo` scope + * The token's user must have write access to the project + * To mitigate risk you may wish to limit the token to a single project by creating a [machine user](https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users) + * Please note the personal access token is required because of an [Actions bug](https://github.com/JamesIves/github-pages-deploy-action/issues/5), and will hopefully be unnecessary in the future +1. Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file) ### Inputs -For more information on these inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input) +For more information on inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input) - `charts-dir`: The charts directory -- `charts-repo-url`: The GitHub Pages URL to the charts repo (default: `https://.github.io/`) +- `charts-repo-url`: The GitHub Pages URL to the charts repo (default: `https://.github.io/`) - `token`: The GitHub token ### Example workflow -Create a workflow (eg: .github/workflows/chart-testing.yml see Creating a Workflow file): +Create a workflow (eg: `.github/workflows/release.yml`. replace `` and `` with your GitHub project's owner and project name): ```yaml -name: chart actions +name: Release Charts on: push: - branches: - - master + branches: + - master jobs: - test: + release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v1 + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email noreply@github.com + - name: Run chart-releaser - uses: helm/chart-releaser-action@v1 + uses: helm/chart-releaser-action@master + env: + CR_TOKEN: "${{ secrets.CR_TOKEN }}" with: - token: "${{ secrets.GITHUB_TOKEN }}" + owner: + repo: ``` -This uses [`@helm/chart-releaser-action`](https://www.github.com/helm/chart-releaser-action) to turn a GitHub repo into a self-hosted Helm chart repo. It does this – during every push to `master` – by checking each chart in your GitHub repo, and whenever there's a new chart version, creates a corresponding [GitHub release](https://help.github.com/en/github/administering-a-repository/about-releases) named for the chart version, adds Helm chart artifacts to the release, and creates or updates an `index.yaml` file with metadata about those releases which is then hosted on GitHub Pages. +This uses [@helm/chart-releaser-action](https://www.github.com/helm/chart-releaser-action) to turn your GitHub project into a self-hosted Helm chart repo. It does this – during every push to `master` – by checking each chart in your project, and whenever there's a new chart version, creates a corresponding [GitHub release](https://help.github.com/en/github/administering-a-repository/about-releases) named for the chart version, adds Helm chart artifacts to the release, and creates or updates an `index.yaml` file with metadata about those releases, which is then hosted on GitHub Pages ## Code of conduct From c21af0f7760fb8e55944c5e744bcdcc4e8c931e4 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Sun, 8 Dec 2019 16:04:13 -0500 Subject: [PATCH 2/4] Update Actions bug link Signed-off-by: Scott Rigby --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c01701..0982228 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi * The token must have `repo` scope * The token's user must have write access to the project * To mitigate risk you may wish to limit the token to a single project by creating a [machine user](https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users) - * Please note the personal access token is required because of an [Actions bug](https://github.com/JamesIves/github-pages-deploy-action/issues/5), and will hopefully be unnecessary in the future + * Please note the personal access token is required because of an [Actions bug](https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/m-p/31266/highlight/true#M743), and will hopefully be unnecessary in the future 1. Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file) ### Inputs From 5c0f6c0acc9b7bfb42a59fcb8ebd638a751ceabd Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Sun, 8 Dec 2019 16:31:16 -0500 Subject: [PATCH 3/4] Remove obselete values Signed-off-by: Scott Rigby --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 0982228..b828825 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,6 @@ jobs: uses: helm/chart-releaser-action@master env: CR_TOKEN: "${{ secrets.CR_TOKEN }}" - with: - owner: - repo: ``` This uses [@helm/chart-releaser-action](https://www.github.com/helm/chart-releaser-action) to turn your GitHub project into a self-hosted Helm chart repo. It does this – during every push to `master` – by checking each chart in your project, and whenever there's a new chart version, creates a corresponding [GitHub release](https://help.github.com/en/github/administering-a-repository/about-releases) named for the chart version, adds Helm chart artifacts to the release, and creates or updates an `index.yaml` file with metadata about those releases, which is then hosted on GitHub Pages From 59eb1e036160967f5895348fff09137e90d6faf1 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Sun, 8 Dec 2019 16:32:03 -0500 Subject: [PATCH 4/4] Remove obselete values note Signed-off-by: Scott Rigby --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b828825..675b217 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ For more information on inputs, see the [API Documentation](https://developer.gi ### Example workflow -Create a workflow (eg: `.github/workflows/release.yml`. replace `` and `` with your GitHub project's owner and project name): +Create a workflow (eg: `.github/workflows/release.yml`): ```yaml name: Release Charts