Check RawGraphs2 Version #119
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 RawGraphs2 Version | |
on: | |
schedule: | |
- cron: '0 4 * * 6' | |
jobs: | |
updateRawGraphs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install libs | |
run: sudo apt-get update && sudo apt-get install curl jq -y | |
- name: Get Latest RawGraphs2.0 Release | |
id: rawgraphs-version | |
run: | | |
echo "release_tag=$(curl -sL https://api.github.com/repos/rawgraphs/rawgraphs-app/releases/latest | jq -r ".tag_name" | cut -b 2-)" >> $GITHUB_OUTPUT | |
echo "current_tag=$(<rawgraphs-version.txt)" >> $GITHUB_OUTPUT | |
- name: Update RawGraphs2 | |
if: steps.rawgraphs-version.outputs.current_tag != steps.rawgraphs-version.outputs.release_tag | |
env: | |
RELEASE_TAG: ${{ steps.rawgraphs-version.outputs.release_tag }} | |
run: | | |
# Update current release | |
echo ${{ steps.rawgraphs-version.outputs.release_tag }} > rawgraphs-version.txt | |
- name: Update Readme.md & Dockerfile | |
uses: jacobtomlinson/gha-find-replace@master | |
with: | |
find: ${{ steps.rawgraphs-version.outputs.current_tag }} | |
replace: ${{ steps.rawgraphs-version.outputs.release_tag }} | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
commit-message: Update rawgraphs-version to ${{ steps.rawgraphs-version.outputs.release_tag }} | |
title: Update rawgraphs-version to ${{ steps.rawgraphs-version.outputs.release_tag }} | |
body: | | |
Updates [rawgraphs-version][1] to ${{ steps.rawgraphs-version.outputs.release_tag }} | |
Auto-generated by [create-pull-request][2] | |
[1]: https://github.com/rawgraphs/rawgraphs-app | |
[2]: https://github.com/peter-evans/create-pull-request | |
labels: dependencies, automated pr | |
branch: rawgraphs-updates | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} |