From 1403f21d1ca7b87c2fa994a29681b527e53eed82 Mon Sep 17 00:00:00 2001 From: Anmol Wadhwani <4815989+anmolw@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:44:14 +0530 Subject: [PATCH] Add weekly iterm2-colorschemes update workflow --- .github/workflows/update-colorschemes.yml | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/update-colorschemes.yml diff --git a/.github/workflows/update-colorschemes.yml b/.github/workflows/update-colorschemes.yml new file mode 100644 index 000000000..897ae406f --- /dev/null +++ b/.github/workflows/update-colorschemes.yml @@ -0,0 +1,53 @@ +name: Update iTerm2 colorschemes +on: + schedule: + # Once a week + - cron: "0 0 * * 0" + workflow_dispatch: +jobs: + update-iterm2-schemes: + if: github.repository == 'ghostty-org/ghostty' + runs-on: ubuntu-latest + permissions: + # Needed for create-pull-request action + contents: write + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Nix + uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Run zig fetch + id: zig_fetch + run: | + UPSTREAM_REV="$(curl "https://api.github.com/repos/mbadolato/iTerm2-Color-Schemes/commits/master" | jq -r '.sha')" + nix develop -c zig fetch --save="iterm2_themes" "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/$UPSTREAM_REV.tar.gz" + echo "upstream_rev=$UPSTREAM_REV" >> "$GITHUB_OUTPUT" + + - name: Update zig cache hash + run: | + # Only proceed if build.zig.zon has changed + if [ "$(git status build.zig.zon --porcelain)" ]; then + nix develop -c ./nix/build-support/check-zig-cache-hash.sh --update + fi + + - name: Create pull request + uses: peter-evans/create-pull-request@v7 + with: + title: Update iTerm2 colorschemes + base: main + branch: iterm2_colors_action + commit-message: "deps: Update iTerm2 color schemes" + add-paths: | + build.zig.zon + nix/zigCacheHash.nix + body: | + Upstream revision: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/${{ steps.zig_fetch.outputs.upstream_rev }} + labels: dependencies +