Check Github Pages Gem Version and Open New Issue on Change #311
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 Github Pages Gem Version and Open New Issue on Change | |
on: | |
schedule: | |
- cron: "00 12 * * *" | |
workflow_dispatch: | |
jobs: | |
check-github-pages-gem-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Daniel Ridge repo | |
uses: actions/checkout@v4 | |
- name: Set ENV variable for current ghpages-docker version number | |
run: echo "PAGES_CURRENT_VERSION=$(cat release-versions/github-pages-gem.txt)" >> $GITHUB_ENV | |
- name: Fetch GitHub Pages Gem release version and save in ENV variable | |
run: echo "PAGES_RELEASE_VERSION=$(curl -sL https://pages.github.com/versions.json | jq -r '."github-pages"')" >> $GITHUB_ENV | |
- name: Write release version to text file | |
run: | | |
echo ${{ env.PAGES_RELEASE_VERSION }} > release-versions/github-pages-gem.txt | |
- name: Check for modified files | |
id: git-check | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "modified=false" >> $GITHUB_ENV | |
else | |
echo "modified=true" >> $GITHUB_ENV | |
fi | |
- name: Commit latest GH-Pages Gem release version | |
if: env.modified == 'true' | |
run: | | |
git config --global user.name 'Daniel Ridge' | |
git config --global user.email '[email protected]' | |
git commit -am "New release version" | |
git push | |
- name: Create issue to update GH-Pages gem | |
if: env.modified == 'true' | |
run: 'gh issue create | |
--repo github.com/hackforla/ops | |
--title "GHPAGES-DOCKER needs to be updated" | |
--body "GitHub Pages is now using **v${{ env.PAGES_RELEASE_VERSION }}** of the GitHub Pages Ruby Gem. You are using **v${{ env.PAGES_CURRENT_VERSION }}**. Please refer to the [ghpages-docker Wiki](https://github.com/hackforla/ghpages-docker/wiki#how-do-you-update-ghpages-docker) for instructions on how to update." | |
--label "feature: maintenance,feature: docker,role: Site Reliability Engineer,size: 0.5pt"' | |
env: | |
GH_TOKEN: ${{ secrets.DR_PAT }} |