Skip to content

Commit

Permalink
Introduce a daily check to bump systeminformer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 16, 2024
1 parent 55e5b7a commit 5bbe3f9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update systeminformer

on:
workflow_dispatch:
schedule:
- cron: '0 15 * * *'

permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Bump the systeminformer version
run: ./update.sh
shell: bash
30 changes: 30 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
pushd systeminformer
git fetch
git diff --exit-code HEAD origin/master -- phnt > /dev/null 2>&1

if [ $? -eq 0 ]; then
echo "No changes to commit"
popd
exit 0
fi

NEW_HASH=$(git rev-parse --short origin/master)

git ls-remote --exit-code --heads upstream bump-$NEW_HASH > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Already bumped"
popd
exit 0
fi

echo "Bumping systeminformer to $NEW_HASH"
git checkout origin/master
popd

git config user.name "GitHub Actions"
git config user.email "[email protected]"
git checkout -b bump-$NEW_HASH
git commit -am "Bump systeminformer to $NEW_HASH"
git push --set-upstream origin bump-$NEW_HASH
gh pr create --title "Bump systeminformer to $NEW_HASH"

0 comments on commit 5bbe3f9

Please sign in to comment.