Check for new RDKit tags #1087
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
name: Check for new RDKit tags | |
on: | |
schedule: | |
# https://crontab.guru/every-night-at-midnight | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
update_tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check out RDKit repo | |
uses: actions/checkout@v3 | |
with: | |
repository: rdkit/rdkit | |
path: rdkit | |
fetch-depth: 0 | |
- name: Get most tags and compare | |
id: tags | |
shell: bash | |
run: | | |
current_tag=$(grep rdkit_tag setup.py | head -1 | xargs -n 1 | tail -1) | |
cd rdkit | |
new_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | |
cd .. | |
rm -fr rdkit | |
echo "changed=false" >> $GITHUB_OUTPUT | |
if [[ "$new_tag" != "$current_tag" ]]; then | |
sed -i "s/rdkit_tag =.*/rdkit_tag = \"$new_tag\"/g" setup.py | |
echo "changed=true" >> $GITHUB_OUTPUT | |
echo "new_tag=${new_tag}" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Pull Request | |
if: ${{ steps.tags.outputs.changed }} | |
uses: gr2m/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: "🤖 Bump RDKit version to ${{ steps.tags.outputs.new_tag }}" | |
branch: "bump-rdkit-${{ steps.tags.outputs.new_tag }}" | |
path: "./" | |
commit-message: "Set RDKit version to ${{ steps.tags.outputs.new_tag }}" | |
body: | | |
New RDKit version tag detected in https://github.com/rdkit/rdkit. | |
reviewers: kuelumbus |