Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Open PR on new BingImageCreator release #95

Open PR on new BingImageCreator release

Open PR on new BingImageCreator release #95

name: Open PR on new BingImageCreator release
on:
workflow_dispatch:
schedule:
- cron: "15 3 * * 1"
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch release version
run: |
latest=$(curl -sL https://pypi.org/pypi/bingimagecreator/json | jq -r ".info.version")
curr=$(sed -E -n 's/BingImageCreator==([a-z0-9.]+)/\1/p' requirements.txt)
echo "new=$([[ "$latest" = "$curr" ]] && echo False || echo True)" >> $GITHUB_ENV
echo "latest=$latest" >> $GITHUB_ENV
- name: Update BingImageCreator version
if: ${{ env.new }}
run: |
sed -E -i "s/(BingImageCreator==)([a-z0-9.]+)/\1${{ env.latest }}/" requirements.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: New BingImageCreator release
title: Automated BingImageCreator PR on new release
branch: BingImageCreator_update
delete-branch: true