Update inputs #89
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
name: Update inputs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: DeterminateSystems/nix-installer-action@v12 | |
- name: Update inputs | |
id: update | |
run: | | |
old="$(sha256sum flake.lock)" | |
nix flake update | |
new="$(sha256sum flake.lock)" | |
if [ "$old" != "$new" ]; then | |
echo "trigger-build=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Trigger build | |
if: ${{ steps.update.outputs.trigger-build }} | |
uses: actions/github-script@v7.0.1 | |
with: | |
script: | | |
github.rest.repos.createDispatchEvent({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
event_type: 'trigger-build', | |
}); | |
- name: Commit flake update | |
if: ${{ steps.update.outputs.trigger-build }} | |
uses: planetscale/ghcommit-action@v0.1.39 | |
with: | |
commit_message: "🤖 Update inputs" | |
repo: ${{ github.repository }} | |
branch: ${{ github.head_ref || github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |