Skip to content

Update Phantom UI

Update Phantom UI #9

name: Update Phantom UI
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
update-phantom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: main
- uses: actions/checkout@v4
with:
repository: PhantomUIx/core
path: phantom-core
- uses: goto-bus-stop/setup-zig@v2
- name: Update Phantom UI
run: |
export PHANTOM_SHA=$(git -C phantom-core rev-parse HEAD)
echo "PHANTOM_SHA=$PHANTOM_SHA" >> $GITHUB_ENV
pushd main
git switch -c update-phantom/$PHANTOM_SHA
zig fetch --save=phantom https://github.com/PhantomUIx/core/archive/$PHANTOM_SHA.tar.gz
git config user.name "GitHub Actions Bot"
git config user.email "<>"
if ! git diff-index --quiet HEAD --; then
git add build.zig.zon
git commit build.zig.zon -m "chore: update core to $PHANTOM_SHA"
export HAS_CHANGES=yes
else
export HAS_CHANGES=no
fi
echo "HAS_CHANGES=$HAS_CHANGES" >> $GITHUB_ENV
popd
- name: Open PR
uses: peter-evans/create-pull-request@v5
if: ${{ env.HAS_CHANGES == 'yes' }}
with:
title: "Update Phantom UI core to ${{ env.PHANTOM_SHA }}"
branch: update-phantom/${{ env.PHANTOM_SHA }}
path: main