generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: depend on version action #168
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
Closed
+24
−0
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e4c08de
feat: depend on version action
0marperez a9e2eaf
final newline
0marperez ff84dbc
typo fixes
0marperez 78f2bc8
feat: logging
0marperez aba40ad
final newline
0marperez 50c4ac0
misc: additional logging
0marperez 8e14c35
fix: update sed expression
0marperez 755e791
misc: debug logs
0marperez b5757e3
misc: better logging
0marperez 0459675
misc: clean logging
0marperez b007460
misc: documentation updates
0marperez 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Depend on version | ||
| description: Updates a libs.versions.toml dependency | ||
|
|
||
| inputs: | ||
| working-directory: | ||
| description: Directory in which the action will run (must contain `gradle/libs.versions.toml`) | ||
| default: . | ||
| dependency: | ||
| description: Name of the dependency to update in `libs.versions.toml`. Must match the exact key used in the file | ||
| version: | ||
| description: The version string to assign to the specified dependency | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Update dependency | ||
| working-directory: ${{inputs.working-directory}} | ||
| shell: bash | ||
| run: | | ||
| echo "Updating depdendency '${{inputs.dependency}}' to '${{inputs.version}}'" | ||
| sed -i "s/^${{ inputs.dependency }} = \".*\"/${{ inputs.dependency }} = \"${{ inputs.version }}\"/" gradle/libs.versions.toml | ||
|
|
||
| echo "Printing first occurence of '${{inputs.dependency}}' in 'libs.versions.toml':" | ||
| grep "${{inputs.dependency}}" gradle/libs.versions.toml | head -n 1 | ||
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.
Suggestion: Since the kat tool already supports reading/modifying version strings in gradle.properties, it feels natural that it would handle libs.versions.toml too. I suggest moving the implementation of version catalog manipulation into kat and eliminate this action.