Get latest Prereq sha #13009
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: Get latest Prereq sha | |
on: | |
schedule: | |
- cron: '0 */3 * * *' | |
jobs: | |
get-guild-prereq: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} | |
- name: Fetch prereq release sha | |
run: | | |
curl -sL -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/cardano-community/guild-operators/commits | grep -v md | grep -A 2 Merge | grep sha | head -n 1 | cut -d "\"" -f 4 > release-versions/guild-prereq-latest.txt | |
- name: Assigns release sha | |
run: | | |
GVERSION=$(cat ./release-versions/guild-prereq-latest.txt) | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") | |
- name: Commit latest release version | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name ${{ secrets.REPO_SCOPED_USER }} | |
git config --global user.email ${{ secrets.REPO_SCOPED_EMAIL }} | |
git commit -am "New prereq released sha: $GVERSION" | |
git push |