Check Octez version #122
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 Octez version | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
octez_version: | |
name: Check the latest Octez release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Install python-requests | |
run: sudo apt-get install python3-requests | |
- name: Check the latest Octez release | |
run: python3 octez_version.py | |
- name: Create a PR for new version | |
if: failure() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export OCTEZ_VERSION=$(cat octez_version) | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git branch -D octez-$OCTEZ_VERSION || true | |
git checkout -b octez-$OCTEZ_VERSION | |
git add . | |
git commit -m "Update Octez binaries to $OCTEZ_VERSION" | |
git push --force origin octez-$OCTEZ_VERSION | |
gh pr create --title "Update Octez binaries to $OCTEZ_VERSION" --body "This PR updates the Octez binaries to the latest version $OCTEZ_VERSION" --base master --head octez-$OCTEZ_VERSION |