-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (42 loc) · 2.03 KB
/
check-gh-pages-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}