bump-loopstructural-pin #1
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
| name: bump-loopstructural-pin | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| check-and-bump: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get latest LoopStructural release | |
| id: latest | |
| run: | | |
| latest=$(curl -s https://api.github.com/repos/Loop3D/LoopStructural/releases/latest | jq -r .tag_name | sed 's/^v//') | |
| echo "version=$latest" >> "$GITHUB_OUTPUT" | |
| - name: Bump pins if minor version changed | |
| id: bump | |
| run: | | |
| latest="${{ steps.latest.outputs.version }}" | |
| latest_minor="${latest%.*}" | |
| changed=0 | |
| for f in requirements/embedded.txt requirements/testing.txt; do | |
| current=$(grep -oP 'LoopStructural~=\K[0-9]+\.[0-9]+\.[0-9]+' "$f") | |
| current_minor="${current%.*}" | |
| if [ "$latest_minor" != "$current_minor" ]; then | |
| sed -i "s/LoopStructural~=[0-9.]\+/LoopStructural~=${latest}/" "$f" | |
| changed=1 | |
| fi | |
| done | |
| echo "changed=$changed" >> "$GITHUB_OUTPUT" | |
| - name: Open pull request | |
| if: steps.bump.outputs.changed == '1' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "fix: bump LoopStructural pin to ${{ steps.latest.outputs.version }}" | |
| title: "Bump LoopStructural pin to ${{ steps.latest.outputs.version }}" | |
| body: | | |
| LoopStructural released a new minor version (${{ steps.latest.outputs.version }}). | |
| This bumps the `~=` pin in `requirements/embedded.txt` and | |
| `requirements/testing.txt` accordingly. | |
| Verify the `qgis-compat` CI job passes before merging. | |
| branch: bump-loopstructural-pin | |
| labels: dependencies |