-
Notifications
You must be signed in to change notification settings - Fork 0
feat(update-chart-dependency): implement action (MAPCO-8106) #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shimoncohen
wants to merge
52
commits into
master
Choose a base branch
from
update-chart-dependency
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 39 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
c213ae2
feat(update-chart-dependency): implement action (MAPCO-8106)
shimoncohen dfc9f34
test(update-chart-dependency): add tests and update logic accordingly
shimoncohen 810e132
chore(update-chart-dependency): upload action dist
shimoncohen a57dddb
fix(update-chart-dependency): support updating helmfile
shimoncohen 002fb32
chore(update-chart-dependency): upload action dist
shimoncohen 21cc069
chore: remove unnecessary variable default
shimoncohen 8901300
refactor(update-chart-dependency): search for helmfile in chart direc…
shimoncohen f2466aa
chore: rename default branch from main to master
shimoncohen 33b3023
chore: fix PR comments and add some comments
shimoncohen bc72fae
build: upgrade action node version to node24
shimoncohen bec894d
chore(update-chart-dependency): upload action dist
shimoncohen d63cad8
Update actions/update-chart-dependency/main.ts
shimoncohen fe62c82
Update actions/update-chart-dependency/main.ts
shimoncohen f8b4dce
Revert "Update actions/update-chart-dependency/main.ts"
shimoncohen 13ebab1
Revert "Update actions/update-chart-dependency/main.ts"
shimoncohen dd7dd87
chore: change action input names
shimoncohen 3e3c375
chore: update dist files
shimoncohen 4efd6d2
refactor: add old and new chart versions to commit messages and PR body
shimoncohen cfae9e5
chore: use intrface from code in tests
shimoncohen 521c11b
refactor: use flatMap instead of forEach
shimoncohen 0a36646
chore: update dist files
shimoncohen 8feb3a2
chore: add action flow diagram to README
shimoncohen 5888cc0
fix: add target-repo action input
shimoncohen 657b4d3
chore: add dist files
shimoncohen 6bfe460
chore: update action.yaml to include target-repo input
shimoncohen 6d231da
refactor: open PR for each directory
shimoncohen 4e1776a
chore: update dist files
shimoncohen 772faa3
feat: support searching for chart files in subdirectories
shimoncohen 0c044a5
refactor: remove target chart prefix feature
shimoncohen fd63c1c
refactor: validate action inputs with zod
shimoncohen 0c0d4c7
chore: update package.json with zod
shimoncohen dfb73ca
fix: look for chart / helmfile in remote repo
shimoncohen ba30758
chore: update function comment
shimoncohen a03e801
chore: upload package json
shimoncohen 4808da7
Update actions/update-chart-dependency/README.md
shimoncohen 285d538
Update actions/update-chart-dependency/README.md
shimoncohen dafe0c9
docs(update-chart-dependency): update action README
shimoncohen f8f284d
fix: updated log text in case no charts are found
shimoncohen be9fd0b
chore: use objects instead of strings and convert to yaml in tests
shimoncohen c02a312
refactor: change pull request to support only one chart update
shimoncohen a612e66
chore: change branch name to reflect chart heirarchy
shimoncohen 1b2c76b
chore: update build
shimoncohen 17b932b
chore: update some quotes in strings
shimoncohen e8a97d5
chore: remove temp cloned directory from branch name
shimoncohen 706da68
chore: add chart or helmfile ending to branch name
shimoncohen f047f38
chore: use chart full path in PR body
shimoncohen 28bad09
chore: chart path in PR title and body shouldn't be sanitized
shimoncohen abb7324
feat: update existing PR for the same chart if exists
shimoncohen d8279a2
test: add more tests for better coverage
shimoncohen 86086b9
refactor: remove chart version from branch name
shimoncohen aadbf20
fix: use helmfile chart key instead of name
shimoncohen 8d33580
feat: update PR information if it already exists and there is a newer…
shimoncohen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Update Helm Chart Dependencies GitHub Action | ||
|
||
This GitHub Action updates the version of a specific dependency in the `Chart` and `helmfile` yaml files for one or more directories in a remote repository, and for each creates a dedicated branch with the chart changes and opens a pull request. | ||
|
||
## Features | ||
|
||
- Accepts a dependency service name and version as inputs. | ||
- Finds all chart directories in a remote repository. | ||
- Updates the version of the specified chart in all Chart.yaml and helmfile.yaml files where it is listed as a dependency. | ||
- Creates new branches from a specified base branch. | ||
- Creates a dedicated branch for each change and opens a PR with a summary of the update details. | ||
- Uses only Node.js built-in modules and the official GitHub Actions toolkit. | ||
|
||
## Inputs | ||
|
||
| Name | Description | Required | Default | | ||
| -------------- | ---------------------------------------------------------------- | -------- | -------- | | ||
| `chart-name` | Name of the dependency to update in Chart / helmfile yaml files. | true | | | ||
| `version` | New version to set for the dependency. | true | | | ||
| `github-token` | GitHub token for authentication. | true | | | ||
| `target-repo` | Target repository to open the PRs in (format: owner/repo). | true | | | ||
| `branch` | Branch to base the PRs on (e.g. `master`). | false | `master` | | ||
|
||
## Usage | ||
|
||
```yaml | ||
- name: Update Helm Chart Dependencies | ||
uses: map-colonies/update-chart-dependency@v1 | ||
with: | ||
chart-name: 'my-dependency' | ||
version: '1.2.3' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
target-repo: 'owner/repo' | ||
branch: 'master' | ||
``` | ||
|
||
## Notes | ||
|
||
- The action updates only the version of the specified dependency in each chart's `Chart` and `helmfile` yaml files. | ||
- The action opens a dedicated branch and PR for each updated chart. | ||
- If no charts require updating, no PR will be opened. | ||
|
||
## License | ||
|
||
MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 'Update Helm Chart Dependencies' | ||
description: 'Updates Chart.yaml for Helm charts and opens a PR with the changes.' | ||
|
||
runs: | ||
using: 'node24' | ||
main: 'dist/index.js' | ||
|
||
inputs: | ||
chart-name: | ||
description: 'Name of the dependency to update in Chart / helmfile.' | ||
required: true | ||
version: | ||
description: 'New version to set for the dependency.' | ||
required: true | ||
github-token: | ||
description: 'GitHub token for authentication.' | ||
required: true | ||
target-repo: | ||
description: 'Repository to update the chart in (format: owner/repo).' | ||
required: true | ||
branch: | ||
description: 'Branch to base the PR on (default: master).' | ||
required: false |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { run } from './main.js'; | ||
|
||
void run(); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The readme can also explain how to use it better (where the action itself sits, whats the target), maybe put a mermaid chart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added diagram.