Skip to content

Commit

Permalink
feat: update eye
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Dec 26, 2022
1 parent 443990b commit 93c7a67
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lib/*.pl.ts
lib/*.temp.ts
*.sh
21 changes: 21 additions & 0 deletions .github/workflows/update-eye.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update to use the latest version of eye
on:
schedule:
- cron: '0 10 * * *'
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Update eye
run: npm run eye:update
- 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: |
chmod u+x ./scripts/update-eye.sh
./scripts/update-eye.sh
17 changes: 17 additions & 0 deletions scripts/update-eye.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
before=$(git diff HEAD~1 | grep "\- \"name\"")
after=$(git diff HEAD~1 | grep "\+ \"name\"")

# Use change in eye version to determine whether
# this needs to be a major, minor or patch update
if [ ${before:17:2} != ${before:17:2} ]; then
version="breaking"
elif [ ${before:20:4} != ${after:20:4} ]; then
version="feat"
elif [ ${before:25:4} != ${after:25:4} ]; then
version="fix"
fi

git config --global user.name 'Jesse Wright'
git config --global user.email '63333554+jeswr@users.noreply.github.com'
git commit -am "$version: update eye"
git push

0 comments on commit 93c7a67

Please sign in to comment.