Skip to content

Commit

Permalink
feat(repository): allow to set a different repository than the one th…
Browse files Browse the repository at this point in the history
…e action is running on
  • Loading branch information
prsnca committed May 7, 2024
1 parent 95930dc commit c7595ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi
- `version`: The chart-releaser version to use (default: v1.6.0)
- `config`: Optional config file for chart-releaser. For more information on the config file, see the [documentation](https://github.com/helm/chart-releaser#config-file)
- `charts_dir`: The charts directory
- `repository`: The repository to release (default: the repository the action is running from). If used - make sure to set the appropriate CR_TOKEN for the targeted repository.
- `skip_packaging`: This option, when populated, will skip the packaging step. This allows you to do more advanced packaging of your charts (for example, with the `helm package` command) before this action runs. This action will only handle the indexing and publishing steps.
- `skip_existing`: Skip package upload if release/tag already exists
- `skip_upload`: This option, when populated, will skip the upload step. This allows you to do more advanced uploading of your charts (for exemple with OCI based repositories) which doen't require the `index.yaml`.
Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ runs:
steps:
- id: release
run: |
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
repo_set=${GITHUB_REPOSITORY}
if [[ -n "${{ inputs.repository }}" ]]; then
repo_set="${{ inputs.repository }}"
fi
owner=$(cut -d '/' -f 1 <<< "$repo_set")
repo=$(cut -d '/' -f 2 <<< "$repo_set")
args=(--owner "$owner" --repo "$repo")
args+=(--charts-dir "${{ inputs.charts_dir }}")
Expand Down

0 comments on commit c7595ea

Please sign in to comment.