Add an update workflow?
This commit is contained in:
31
.github/workflows/update.yml
vendored
Normal file
31
.github/workflows/update.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Update the version
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '39 0/6 * * *'
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: DeterminateSystems/nix-installer-action@v4
|
||||||
|
- uses: DeterminateSystems/magic-nix-cache-action@v2
|
||||||
|
- run: nix-shell update.sh
|
||||||
|
id: update
|
||||||
|
- if: ${{ steps.update.outputs.changed }}
|
||||||
|
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
|
||||||
|
id: generate-token
|
||||||
|
with:
|
||||||
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
- if: ${{ steps.update.outputs.changed }}
|
||||||
|
name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@d9d6fd980e1e0904e8e4dce3f0992640091bde37
|
||||||
|
with:
|
||||||
|
title: "Update package to ${{ steps.update.outputs.version }}"
|
||||||
|
body: ''
|
||||||
|
delete-branch: true
|
||||||
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
base: main
|
||||||
@@ -18,3 +18,12 @@ curl -L https://github.com/openhab/openhab-distro/releases/download/"$MOST_RECEN
|
|||||||
| cut -d" " -f1 \
|
| cut -d" " -f1 \
|
||||||
| tr -d '\n' \
|
| tr -d '\n' \
|
||||||
> openhab-addons.sha256
|
> openhab-addons.sha256
|
||||||
|
|
||||||
|
if ! git diff --quiet "version"; then
|
||||||
|
if [[ -v GITHUB_OUTPUT ]]; then
|
||||||
|
echo "version=$MOST_RECENT" >> $GITHUB_OUTPUT
|
||||||
|
echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user