From e42b1f97251e16ffda3a0100556d22a1937eb74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Mon, 8 Jun 2026 22:11:54 +0200 Subject: [PATCH 01/16] librewolf profiles selector: added tor-browser --- modules/applications/browser.nix | 2 +- modules/applications/hyprland.nix | 4 ++-- ...olfprofiles.nix => custom-browserprofiles.nix} | 15 +++++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) rename modules/packages/{custom-librewolfprofiles.nix => custom-browserprofiles.nix} (59%) diff --git a/modules/applications/browser.nix b/modules/applications/browser.nix index 6841165..8cad7d4 100644 --- a/modules/applications/browser.nix +++ b/modules/applications/browser.nix @@ -7,7 +7,7 @@ environment.systemPackages = with pkgs; [ chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID. pkgs-unstable.tor-browser - self.packages.${pkgs.system}.custom-librewolfprofiles + self.packages.${pkgs.system}.custom-browserprofiles ]; }; flake.homeModules.librewolf = _: { diff --git a/modules/applications/hyprland.nix b/modules/applications/hyprland.nix index 3c9f9fa..d2c3c4a 100644 --- a/modules/applications/hyprland.nix +++ b/modules/applications/hyprland.nix @@ -74,7 +74,7 @@ "$editor" = "nvim"; "$notes" = "kitty --class \"custom-obsidianvaults\" --name \"Select Obsidian vault\" --hold custom-obsidianvaults"; "$file" = "dolphin"; - "$browser" = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; + "$browser" = "kitty --class \"custom-browserprofiles\" --name \"Select browser profile\" --hold custom-browserprofiles"; # ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ # █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ animations = { @@ -487,7 +487,7 @@ "float on, match:class ^(kitty)$, match:title ^(htop)$" "float on, match:class ^(vlc)$" "float on, match:class ^(eog)$" - "float on, size 400 225, match:class ^(custom-librewolfprofiles)$" + "float on, size 400 225, match:class ^(custom-browserprofiles)$" "float on, size 1050 200, match:class ^(custom-changeAudioOutput)$" "float on, size 400 175, match:class ^(custom-obsidianvaults)$" "float on, size 600 600, match:initial_class ^(custom-pomodoro)$" diff --git a/modules/packages/custom-librewolfprofiles.nix b/modules/packages/custom-browserprofiles.nix similarity index 59% rename from modules/packages/custom-librewolfprofiles.nix rename to modules/packages/custom-browserprofiles.nix index df79ed3..cc5275e 100644 --- a/modules/packages/custom-librewolfprofiles.nix +++ b/modules/packages/custom-browserprofiles.nix @@ -1,18 +1,19 @@ _: { perSystem = {pkgs, ...}: { # fzf librewolf profile selector - packages.custom-librewolfprofiles = pkgs.writeShellApplication { - name = "custom-librewolfprofiles"; + packages.custom-browserprofiles = pkgs.writeShellApplication { + name = "custom-browserprofiles"; runtimeInputs = with pkgs; [ zsh fzf + tor-browser ]; text = '' # List of profiles - profiles=("work" "other" "private window") + profiles=("work" "other" "private window" "tor-browser) # Use fzf to select - selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:") + selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select browser profile:") # If user cancels, exit [[ -z "$selected" ]] && exit 0 @@ -20,10 +21,12 @@ _: { # Launch LibreWolf detached, keeping environment if [[ "$selected" == "private window" ]]; then setsid librewolf --private-window --no-remote >/dev/null 2>&1 & - pkill -f "kitty.*Select LibreWolf profile" + pkill -f "kitty.*Select browser profile" + elif [[ "$selected" == "tor-browser" ]]; then + setsid tor-browser >/dev/null 2>&1 & pkill -f "kitty.*Select browser profile" else setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 & - pkill -f "kitty.*Select LibreWolf profile" + pkill -f "kitty.*Select browser profile" fi # Exit the kitty terminal after selection From 75002217f342874c4be784afe22651e09434906b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Mon, 8 Jun 2026 22:12:43 +0200 Subject: [PATCH 02/16] fix: home.file --- modules/utilities/nixGitCherryPicker.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/utilities/nixGitCherryPicker.nix b/modules/utilities/nixGitCherryPicker.nix index f1dc079..6e64b1e 100644 --- a/modules/utilities/nixGitCherryPicker.nix +++ b/modules/utilities/nixGitCherryPicker.nix @@ -15,4 +15,20 @@ force = true; }; }; + flake.homeModules.nix-git-cherry-picker-desktop = {pkgs, ...}: { + home.packages = [ + inputs.nix-git-cherry-picker.packages.${pkgs.system}.default + ]; + }; + home.file.".config/nix-git-cherry-picker/config.json" = { + enable = true; + text = '' + { + "localBranch": "desktop", + "remoteBranch": "laptop", + "nixConfigPath": "/home/tomasr/nixos/" + } + ''; + force = true; + }; } From fa54be1c2b60b570cecd46d6b2c7bee0bf4e89f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Mon, 8 Jun 2026 22:14:47 +0200 Subject: [PATCH 03/16] fix: cherry-picker-desktop --- modules/utilities/nixGitCherryPicker.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/utilities/nixGitCherryPicker.nix b/modules/utilities/nixGitCherryPicker.nix index 6e64b1e..ce2ea5d 100644 --- a/modules/utilities/nixGitCherryPicker.nix +++ b/modules/utilities/nixGitCherryPicker.nix @@ -19,16 +19,16 @@ home.packages = [ inputs.nix-git-cherry-picker.packages.${pkgs.system}.default ]; - }; - home.file.".config/nix-git-cherry-picker/config.json" = { - enable = true; - text = '' - { - "localBranch": "desktop", - "remoteBranch": "laptop", - "nixConfigPath": "/home/tomasr/nixos/" - } - ''; - force = true; + home.file.".config/nix-git-cherry-picker/config.json" = { + enable = true; + text = '' + { + "localBranch": "desktop", + "remoteBranch": "laptop", + "nixConfigPath": "/home/tomasr/nixos/" + } + ''; + force = true; + }; }; } From 32c9d85f99254539f65815ad67cedd8a4e16ff40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Mon, 8 Jun 2026 22:20:24 +0200 Subject: [PATCH 04/16] fix: custom-browserprofiles --- modules/packages/custom-browserprofiles.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/packages/custom-browserprofiles.nix b/modules/packages/custom-browserprofiles.nix index cc5275e..fda0578 100644 --- a/modules/packages/custom-browserprofiles.nix +++ b/modules/packages/custom-browserprofiles.nix @@ -10,7 +10,7 @@ _: { ]; text = '' # List of profiles - profiles=("work" "other" "private window" "tor-browser) + profiles=("work" "other" "private window" "tor-browser") # Use fzf to select selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select browser profile:") From 6d15ae6a22101931848365bc7c4eee48e8f1f14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 11:48:31 +0200 Subject: [PATCH 05/16] fix nixGitCherryPicker --- modules/utilities/nixGitCherryPicker.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/utilities/nixGitCherryPicker.nix b/modules/utilities/nixGitCherryPicker.nix index ce2ea5d..bd649ce 100644 --- a/modules/utilities/nixGitCherryPicker.nix +++ b/modules/utilities/nixGitCherryPicker.nix @@ -1,5 +1,5 @@ {inputs, ...}: { - flake.homeModules.nix-git-cherry-picker-desktop = {pkgs, ...}: { + flake.homeModules.nix-git-cherry-picker-laptop = {pkgs, ...}: { home.packages = [ inputs.nix-git-cherry-picker.packages.${pkgs.system}.default ]; @@ -7,8 +7,8 @@ enable = true; text = '' { - "localBranch": "desktop", - "remoteBranch": "laptop", + "localBranch": "laptop", + "remoteBranch": "desktop", "nixConfigPath": "/home/tomasr/nixos/" } ''; From 0beb6f374ac62806712fd47bea64d72a2581ad7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 11:51:52 +0200 Subject: [PATCH 06/16] patent: use flake.nix --- modules/utilities/development.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/utilities/development.nix b/modules/utilities/development.nix index d8cec56..49f46ce 100644 --- a/modules/utilities/development.nix +++ b/modules/utilities/development.nix @@ -35,6 +35,7 @@ gnupg pinentry-curses inputs.nixpkgs-notifier.packages.${pkgs.system}.default + inputs.patent.packages.${pkgs.system}.default ]; }; flake.homeModules.development = _: { From 682bc4e5abdebfe8dc4bf5ccf1869f53f532013c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 11:54:49 +0200 Subject: [PATCH 07/16] patent: flake.lock --- flake.lock | 48 +++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 5 +++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index f262f02..92c8dc5 100644 --- a/flake.lock +++ b/flake.lock @@ -338,6 +338,30 @@ "type": "github" } }, + "patent": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs-unstable" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1780942898, + "narHash": "sha256-cP4gUX4YE1kFe+15Zd1CbqL08XytPm1UXZuaXjYLG94=", + "owner": "r14dd", + "repo": "patent", + "rev": "bbad654b6b65264d2ba267b5c87e8be0bd89b78e", + "type": "github" + }, + "original": { + "owner": "r14dd", + "repo": "patent", + "type": "github" + } + }, "quickshell": { "inputs": { "nixpkgs": [ @@ -374,7 +398,29 @@ "nixpkgs-master": "nixpkgs-master", "nixpkgs-notifier": "nixpkgs-notifier", "nixpkgs-unstable": "nixpkgs-unstable", - "notewrapper": "notewrapper" + "notewrapper": "notewrapper", + "patent": "patent" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "patent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1780888890, + "narHash": "sha256-MUQPFiskEENaJ2N82TRIqpKlHXGXJJkPfKH6W788oQo=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "7d5f8d75fc195a236b46633d7679139698aeb35f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index 49139ac..a95a4ee 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,11 @@ inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + patent = { + url = "github:r14dd/patent"; + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; caelestia-shell = { # based on quickshell. See https://github.com/caelestia-dots/shell url = "github:caelestia-dots/shell"; From dc09f6dcceba5c547c7aba9810285347a2182747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 11:55:08 +0200 Subject: [PATCH 08/16] snapshot pre-autoupdate-2026-06-09T09-55-08Z From 18d73c71c3bd6bea17ea53e33cdca07c9439ac40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 11:58:39 +0200 Subject: [PATCH 09/16] update flake.lock --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 92c8dc5..7fc496e 100644 --- a/flake.lock +++ b/flake.lock @@ -34,11 +34,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1780907625, - "narHash": "sha256-YH1LHLhoAlSmXmVz9qhY+QLFWbLVFJWSaPJ3ORr5grQ=", + "lastModified": 1780996864, + "narHash": "sha256-OIDk3FiSKjYLV4Dvfv6fMeVcV3Dk9+MBBKTORNqMsUg=", "owner": "caelestia-dots", "repo": "shell", - "rev": "66a9f2f220a9cc6a29ce4b66691f0117bdd35704", + "rev": "c46593d438a75fce42f28529662b678b79d94693", "type": "github" }, "original": { @@ -246,11 +246,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1780928217, - "narHash": "sha256-Cvq31DIGCKet/UFsJd20YIwCoZmX91xQBV5oiR1bU1k=", + "lastModified": 1780997039, + "narHash": "sha256-8pPXOCZkrySE3zwtix2MYxm9NzzHT/XQr0mHJsf3lis=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2ef2f7e4a2999ffaab2ac987e69f5f8e29ec73cf", + "rev": "872eb0174d0d5a1bc37388ff84eea2bca44b1065", "type": "github" }, "original": { @@ -285,11 +285,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1780747962, - "narHash": "sha256-IX7G1dlKrOqPOImfbo7ADDfV5yU1+j+MRChI3TL4tAA=", + "lastModified": 1780930886, + "narHash": "sha256-rppURzHviaQN131F+nLiLdGfcb0uCd9gGP0E5+iw9MI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cbb5cf358f50aa6acc9efd6113b7bcfbc352cd73", + "rev": "8c3cede7ddc26bd659d2d383b5610efbd2c7a16e", "type": "github" }, "original": { @@ -301,11 +301,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1780734595, - "narHash": "sha256-DmTfP92QFYRLOGXlMIE54MAgxSJjDWocl3gRNOu72Os=", + "lastModified": 1780902259, + "narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9b696460ac78b5ccfc17c854d8c976f20456e943", + "rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca", "type": "github" }, "original": { From 89d5ac8a17d4ccba5913fbb046a1ea198def4234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 16:26:34 +0200 Subject: [PATCH 10/16] micro-vivify: comment out from flake.nix --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index a95a4ee..363ea8a 100644 --- a/flake.nix +++ b/flake.nix @@ -45,10 +45,10 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; - microPlugins-vivify = { + /*microPlugins-vivify = { url = "git+https://codeberg.org/gibbert/micro-vivify"; flake = false; - }; + };*/ flake-parts = { url = "github:hercules-ci/flake-parts"; }; From 259ee7e5541402550e4b141ce2b0553124c3d2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 20:11:13 +0200 Subject: [PATCH 11/16] mathematics: init module with lean4 --- modules/applications/mathematics.nix | 7 +++++++ modules/hosts/desktop.nix | 1 + modules/hosts/laptop.nix | 1 + 3 files changed, 9 insertions(+) create mode 100644 modules/applications/mathematics.nix diff --git a/modules/applications/mathematics.nix b/modules/applications/mathematics.nix new file mode 100644 index 0000000..943a2f0 --- /dev/null +++ b/modules/applications/mathematics.nix @@ -0,0 +1,7 @@ +_: { + flake.nixosModules.mathematics = {pkgs, ...}: { + environment.systemPackages = with pkgs; [ + lean4 + ]; + }; +} diff --git a/modules/hosts/desktop.nix b/modules/hosts/desktop.nix index b46a235..fa83317 100644 --- a/modules/hosts/desktop.nix +++ b/modules/hosts/desktop.nix @@ -35,6 +35,7 @@ kdrive-desktop # we will setup this later latex ly + mathematics mullvad networking notifications diff --git a/modules/hosts/laptop.nix b/modules/hosts/laptop.nix index f6b1400..85fe064 100644 --- a/modules/hosts/laptop.nix +++ b/modules/hosts/laptop.nix @@ -36,6 +36,7 @@ kdrive-laptop latex ly + mathematics mullvad networking notifications From d9969cbd715bba108e10a4f2ad297262ef2e2101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Tue, 9 Jun 2026 20:11:13 +0200 Subject: [PATCH 12/16] mathematics: init module with lean4 --- modules/applications/mathematics.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/applications/mathematics.nix b/modules/applications/mathematics.nix index 943a2f0..2d8ce6e 100644 --- a/modules/applications/mathematics.nix +++ b/modules/applications/mathematics.nix @@ -1,7 +1,7 @@ _: { flake.nixosModules.mathematics = {pkgs, ...}: { environment.systemPackages = with pkgs; [ - lean4 + elan ]; }; } From a063b505c6c7cbd771e7b0218da0df6ac80b5d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Wed, 10 Jun 2026 10:26:16 +0200 Subject: [PATCH 13/16] CI: weekly PR merge to main from desktop and laptop --- .github/workflows/sync-main.yml | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/sync-main.yml diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml new file mode 100644 index 0000000..d92f97f --- /dev/null +++ b/.github/workflows/sync-main.yml @@ -0,0 +1,58 @@ +name: Sync branches into main + +on: + schedule: + - cron: "0 14 * * 1" + + - cron: "0 14 * * 3" + + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Determine source branch + id: branch + run: | + DOW=$(date -u +%u) + + if [ "$DOW" = "1" ]; then + echo "source=laptop" >> "$GITHUB_OUTPUT" + elif [ "$DOW" = "3" ]; then + echo "source=desktop" >> "$GITHUB_OUTPUT" + else + echo "Not a scheduled sync day" + exit 1 + fi + + - name: Create pull request + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: main + branch: ${{ steps.branch.outputs.source }} + title: "Weekly sync: ${{ steps.branch.outputs.source }} → main" + body: | + This pull request was created automatically by GitHub Actions. + + If the branch can be merged cleanly, auto-merge will merge it automatically. + + If there are merge conflicts, this PR will remain open until they are resolved. + draft: false + + - name: Enable auto-merge + if: steps.cpr.outputs.pull-request-number + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr merge \ + ${{ steps.cpr.outputs.pull-request-number }} \ + --auto \ + --merge From 2c95860f5b9689c42fb634170375f2eacfe8ff4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Wed, 10 Jun 2026 20:14:49 +0200 Subject: [PATCH 14/16] CI: fix auto merge action --- .github/workflows/sync-main.yml | 81 +++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 19 deletions(-) diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml index d92f97f..6a9fb9d 100644 --- a/.github/workflows/sync-main.yml +++ b/.github/workflows/sync-main.yml @@ -2,11 +2,18 @@ name: Sync branches into main on: schedule: - - cron: "0 14 * * 1" - - - cron: "0 14 * * 3" + - cron: "0 14 * * 1" # Monday + - cron: "0 14 * * 3" # Wednesday workflow_dispatch: + inputs: + source: + description: Branch to sync into main + required: true + type: choice + options: + - laptop + - desktop permissions: contents: write @@ -20,6 +27,11 @@ jobs: - name: Determine source branch id: branch run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "source=${{ inputs.source }}" >> "$GITHUB_OUTPUT" + exit 0 + fi + DOW=$(date -u +%u) if [ "$DOW" = "1" ]; then @@ -27,32 +39,63 @@ jobs: elif [ "$DOW" = "3" ]; then echo "source=desktop" >> "$GITHUB_OUTPUT" else - echo "Not a scheduled sync day" + echo "No sync scheduled today." exit 1 fi - - name: Create pull request - id: cpr - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: main - branch: ${{ steps.branch.outputs.source }} - title: "Weekly sync: ${{ steps.branch.outputs.source }} → main" - body: | - This pull request was created automatically by GitHub Actions. + - name: Check for existing PR + id: existing + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=$(gh pr list \ + --base main \ + --head "${{ steps.branch.outputs.source }}" \ + --state open \ + --json number \ + --jq '.[0].number') - If the branch can be merged cleanly, auto-merge will merge it automatically. + echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" - If there are merge conflicts, this PR will remain open until they are resolved. - draft: false + - name: Create PR if needed + id: pr + if: steps.existing.outputs.number == '' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_URL=$(gh pr create \ + --base main \ + --head "${{ steps.branch.outputs.source }}" \ + --title "Weekly sync: ${{ steps.branch.outputs.source }} → main" \ + --body "$(cat <> "$GITHUB_OUTPUT" + echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" + + - name: Determine PR number + id: final + run: | + if [ -n "${{ steps.existing.outputs.number }}" ]; then + echo "number=${{ steps.existing.outputs.number }}" >> "$GITHUB_OUTPUT" + else + echo "number=${{ steps.pr.outputs.number }}" >> "$GITHUB_OUTPUT" + fi - name: Enable auto-merge - if: steps.cpr.outputs.pull-request-number + if: steps.final.outputs.number != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr merge \ - ${{ steps.cpr.outputs.pull-request-number }} \ + "${{ steps.final.outputs.number }}" \ --auto \ --merge From c92a868718e83edf3fe42a75a83908bec3456988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Wed, 10 Jun 2026 20:17:57 +0200 Subject: [PATCH 15/16] CI: fix git repo --- .github/workflows/sync-main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml index 6a9fb9d..a08095c 100644 --- a/.github/workflows/sync-main.yml +++ b/.github/workflows/sync-main.yml @@ -47,9 +47,11 @@ jobs: id: existing env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} run: | PR_NUMBER=$(gh pr list \ --base main \ + --repo "$REPO" \ --head "${{ steps.branch.outputs.source }}" \ --state open \ --json number \ @@ -65,6 +67,7 @@ jobs: run: | PR_URL=$(gh pr create \ --base main \ + --repo "$REPO" \ --head "${{ steps.branch.outputs.source }}" \ --title "Weekly sync: ${{ steps.branch.outputs.source }} → main" \ --body "$(cat < Date: Wed, 10 Jun 2026 20:19:26 +0200 Subject: [PATCH 16/16] CI: rewrite with checkout --- .github/workflows/sync-main.yml | 80 ++++++++++++++++----------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml index a08095c..8b95eba 100644 --- a/.github/workflows/sync-main.yml +++ b/.github/workflows/sync-main.yml @@ -24,6 +24,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Determine source branch id: branch run: | @@ -34,24 +37,47 @@ jobs: DOW=$(date -u +%u) - if [ "$DOW" = "1" ]; then - echo "source=laptop" >> "$GITHUB_OUTPUT" - elif [ "$DOW" = "3" ]; then - echo "source=desktop" >> "$GITHUB_OUTPUT" - else - echo "No sync scheduled today." - exit 1 - fi + case "$DOW" in + 1) + echo "source=laptop" >> "$GITHUB_OUTPUT" + ;; + 3) + echo "source=desktop" >> "$GITHUB_OUTPUT" + ;; + *) + echo "No sync scheduled today." + exit 1 + ;; + esac - name: Check for existing PR id: existing env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} run: | PR_NUMBER=$(gh pr list \ --base main \ - --repo "$REPO" \ + --head "${{ steps.branch.outputs.source }}" \ + --state open \ + --json number \ + --jq '.[0].number // empty') + + echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" + + - name: Create PR + id: create + if: steps.existing.outputs.number == '' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr create \ + --base main \ + --head "${{ steps.branch.outputs.source }}" \ + --title "Weekly sync: ${{ steps.branch.outputs.source }} → main" \ + --body "This pull request was created automatically by GitHub Actions." + + PR_NUMBER=$(gh pr list \ + --base main \ --head "${{ steps.branch.outputs.source }}" \ --state open \ --json number \ @@ -59,47 +85,21 @@ jobs: echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" - - name: Create PR if needed - id: pr - if: steps.existing.outputs.number == '' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_URL=$(gh pr create \ - --base main \ - --repo "$REPO" \ - --head "${{ steps.branch.outputs.source }}" \ - --title "Weekly sync: ${{ steps.branch.outputs.source }} → main" \ - --body "$(cat <> "$GITHUB_OUTPUT" - echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" - - name: Determine PR number - id: final + id: pr run: | if [ -n "${{ steps.existing.outputs.number }}" ]; then echo "number=${{ steps.existing.outputs.number }}" >> "$GITHUB_OUTPUT" else - echo "number=${{ steps.pr.outputs.number }}" >> "$GITHUB_OUTPUT" + echo "number=${{ steps.create.outputs.number }}" >> "$GITHUB_OUTPUT" fi - name: Enable auto-merge - if: steps.final.outputs.number != '' + if: steps.pr.outputs.number != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr merge \ - "${{ steps.final.outputs.number }}" \ - --repo "$REPO" \ + "${{ steps.pr.outputs.number }}" \ --auto \ --merge