Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/utils/depend-on-version/action.yml
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
Comment on lines +13 to +24
Copy link
Contributor

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.

Loading