Skip to content

Build After PVS Update #922

Build After PVS Update

Build After PVS Update #922

name: Build After PVS Update
on:
workflow_dispatch:
schedule:
- cron: '0 */4 * * *'
env:
PVS_HASH: ${{ vars.PVS_HASH }}
jobs:
build-after-pvs-update:
name: Build After PVS Update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get remote PVS hash
id: get-pvs-hash
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
NEW_HASH=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
https://api.github.com/repos/ai-dock/stable-diffusion-webui/contents/config/provisioning | \
jq -r '.[] | select(.name == "default.sh") | .sha')
echo "New hash: $NEW_HASH"
echo "Current hash: $PVS_HASH"
if [ "$NEW_HASH" != "$PVS_HASH" ]; then
echo "Hashes are different. Updating..."
echo "update_needed=true" >> $GITHUB_OUTPUT
echo "new_hash=$NEW_HASH" >> $GITHUB_OUTPUT
else
echo "Hashes are the same. No update needed."
echo "update_needed=false" >> $GITHUB_OUTPUT
fi
- name: Update PVS_HASH if different
if: steps.get-pvs-hash.outputs.update_needed == 'true'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh variable set PVS_HASH -b ${{ steps.get-pvs-hash.outputs.new_hash }}
- name: Trigger update workflow
if: steps.get-pvs-hash.outputs.update_needed == 'true'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh workflow run build-after-commit.yml