-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure all asdf managed versions can be installed after updated by re…
…novatebot kachick/renovate-config-asdf#304
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
name: CI - .tool-versions | ||
on: | ||
pull_request: | ||
paths: | ||
- '.tool-versions' | ||
- '**/.tool-versions' | ||
|
||
jobs: | ||
installable: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: git fetch origin ${{ github.base_ref }} --depth=1 | ||
- name: Re-format only changed .tool-versions | ||
id: format-only-new-versions | ||
# Do not use `echo json=$(script)` syntax here. The script generates multilines. | ||
run: | | ||
tempfile="$(mktemp)" | ||
echo -n 'json=' | tee --append "$tempfile" | ||
git diff origin/${{ github.base_ref }} HEAD --word-diff --relative ./examples/.tool-versions | grep -F ']{+' | ruby -r json -e 'puts STDIN.each_line.map { |l| /\A(\S+\s+).*?\{\+([^\+]+)/.match(l).captures.join }.join("\n").to_json' | tee --append "$tempfile" | ||
cat "$tempfile" | tee --append $GITHUB_OUTPUT | ||
- uses: asdf-vm/actions/install@v1 | ||
with: | ||
tool_versions: '${{ fromJson(steps.format-only-new-versions.outputs.json) }}' |