-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a daily check to bump systeminformer
- Loading branch information
Showing
3 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
pushd systeminformer | ||
git fetch | ||
git diff --exit-code HEAD origin/master -- phnt > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo "[INFO] No changes to commit" | ||
popd | ||
exit 0 | ||
fi | ||
|
||
NEW_HASH=$(git rev-parse --short origin/master) | ||
|
||
echo "[INFO] Checking if bump-$NEW_HASH already exists" | ||
git fetch | ||
git ls-remote --exit-code --heads origin bump-$NEW_HASH > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo "[INFO] Already bumped" | ||
popd | ||
exit 0 | ||
fi | ||
|
||
echo "[INFO] Bumping systeminformer to $NEW_HASH" | ||
git checkout origin/master | ||
popd | ||
|
||
echo "[INFO] Creating pull request" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
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 --fill |