Skip to content

Check for Updates

Check for Updates #60

name: Check for Updates
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
jobs:
verify_commit:
runs-on: ubuntu-latest
outputs:
RUN_BUILD: ${{ steps.verify_commit.outputs.RUN_BUILD }}
steps:
- uses: actions/checkout@v3
- id: verify_commit
run: |
if git log --since='24 hours ago' --oneline | grep '.'; then
echo "::set-output name=RUN_BUILD::true"
else
echo "::set-output name=RUN_BUILD::false"
fi
trigger_build:
runs-on: ubuntu-latest
needs: verify_commit
if: ${{ needs.verify_commit.outputs.RUN_BUILD == 'true' }}
steps:
- name: Trigger Nightly Build Workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/nightly-build.yml/dispatches \
-d '{"ref":"main"}'