Skip to content

Commit c7595ea

Browse files
committed
feat(repository): allow to set a different repository than the one the action is running on
1 parent 95930dc commit c7595ea

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi
1818
- `version`: The chart-releaser version to use (default: v1.6.0)
1919
- `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)
2020
- `charts_dir`: The charts directory
21+
- `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.
2122
- `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.
2223
- `skip_existing`: Skip package upload if release/tag already exists
2324
- `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`.

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ runs:
6969
steps:
7070
- id: release
7171
run: |
72-
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
73-
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
72+
repo_set=${GITHUB_REPOSITORY}
73+
if [[ -n "${{ inputs.repository }}" ]]; then
74+
repo_set="${{ inputs.repository }}"
75+
fi
76+
owner=$(cut -d '/' -f 1 <<< "$repo_set")
77+
repo=$(cut -d '/' -f 2 <<< "$repo_set")
7478
7579
args=(--owner "$owner" --repo "$repo")
7680
args+=(--charts-dir "${{ inputs.charts_dir }}")

0 commit comments

Comments
 (0)