Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Update dependency python/cpython to v3.12.2 #747

Update dependency python/cpython to v3.12.2

Update dependency python/cpython to v3.12.2 #747

name: CI - .tool-versions
on:
pull_request:
paths:
- 'examples/.tool-versions'
jobs:
installable:
if: ${{ github.actor == 'renovate[bot]' }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }} --depth=1
- name: Install gh-action-escape
run: curl -fsSL https://raw.githubusercontent.com/kachick/gh-action-escape/v0.2.0/scripts/install-in-github-action.sh | sh -s v0.2.0
- 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: |
targets="$(mktemp)"
git diff origin/${{ github.base_ref }} HEAD --word-diff --relative ./examples/.tool-versions | \
grep -F ']{+' | grep -vP 'haskell|php|node' | ruby -e 'puts STDIN.each_line.map { |l| /\A(\S+\s+).*?\{\+([^\+]+)/.match(l).captures.join }.join("\n")' > "$targets"
gh-action-escape -name=lines < "$targets" | tee -a "$GITHUB_OUTPUT"
grep -P '\S' "$targets" || echo 'skip_install=true' | tee -a "$GITHUB_OUTPUT"
- uses: asdf-vm/actions/install@v3
if: steps.format-only-new-versions.outputs.skip_install != 'true'
with:
tool_versions: |
${{ steps.format-only-new-versions.outputs.lines }}