Merge branch 'main' into laptop

This commit is contained in:
2026-06-12 14:32:38 +00:00
committed by GitHub
3 changed files with 119 additions and 36 deletions
+74 -27
View File
@@ -2,11 +2,18 @@ name: Sync branches into main
on: on:
schedule: schedule:
- cron: "0 14 * * 1" - cron: "0 14 * * 1" # Monday
- cron: "0 14 * * 3" # Wednesday
- cron: "0 14 * * 3"
workflow_dispatch: workflow_dispatch:
inputs:
source:
description: Branch to sync into main
required: true
type: choice
options:
- laptop
- desktop
permissions: permissions:
contents: write contents: write
@@ -17,42 +24,82 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Determine source branch - name: Determine source branch
id: branch id: branch
run: | run: |
DOW=$(date -u +%u) if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "source=${{ inputs.source }}" >> "$GITHUB_OUTPUT"
if [ "$DOW" = "1" ]; then exit 0
echo "source=laptop" >> "$GITHUB_OUTPUT"
elif [ "$DOW" = "3" ]; then
echo "source=desktop" >> "$GITHUB_OUTPUT"
else
echo "Not a scheduled sync day"
exit 1
fi fi
- name: Create pull request DOW=$(date -u +%u)
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. case "$DOW" in
1)
echo "source=laptop" >> "$GITHUB_OUTPUT"
;;
3)
echo "source=desktop" >> "$GITHUB_OUTPUT"
;;
*)
echo "No sync scheduled today."
exit 1
;;
esac
If there are merge conflicts, this PR will remain open until they are resolved. - name: Check for existing PR
draft: false 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 // 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 \
--jq '.[0].number')
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
- name: Determine PR number
id: pr
run: |
if [ -n "${{ steps.existing.outputs.number }}" ]; then
echo "number=${{ steps.existing.outputs.number }}" >> "$GITHUB_OUTPUT"
else
echo "number=${{ steps.create.outputs.number }}" >> "$GITHUB_OUTPUT"
fi
- name: Enable auto-merge - name: Enable auto-merge
if: steps.cpr.outputs.pull-request-number if: steps.pr.outputs.number != ''
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
gh pr merge \ gh pr merge \
${{ steps.cpr.outputs.pull-request-number }} \ "${{ steps.pr.outputs.number }}" \
--auto \ --auto \
--merge --merge
Generated
+25 -9
View File
@@ -34,11 +34,11 @@
"quickshell": "quickshell" "quickshell": "quickshell"
}, },
"locked": { "locked": {
"lastModified": 1780907625, "lastModified": 1780996864,
"narHash": "sha256-YH1LHLhoAlSmXmVz9qhY+QLFWbLVFJWSaPJ3ORr5grQ=", "narHash": "sha256-OIDk3FiSKjYLV4Dvfv6fMeVcV3Dk9+MBBKTORNqMsUg=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "shell", "repo": "shell",
"rev": "66a9f2f220a9cc6a29ce4b66691f0117bdd35704", "rev": "c46593d438a75fce42f28529662b678b79d94693",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -212,11 +212,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1780928217, "lastModified": 1780997039,
"narHash": "sha256-Cvq31DIGCKet/UFsJd20YIwCoZmX91xQBV5oiR1bU1k=", "narHash": "sha256-8pPXOCZkrySE3zwtix2MYxm9NzzHT/XQr0mHJsf3lis=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2ef2f7e4a2999ffaab2ac987e69f5f8e29ec73cf", "rev": "872eb0174d0d5a1bc37388ff84eea2bca44b1065",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -251,11 +251,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1780747962, "lastModified": 1780930886,
"narHash": "sha256-IX7G1dlKrOqPOImfbo7ADDfV5yU1+j+MRChI3TL4tAA=", "narHash": "sha256-rppURzHviaQN131F+nLiLdGfcb0uCd9gGP0E5+iw9MI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cbb5cf358f50aa6acc9efd6113b7bcfbc352cd73", "rev": "8c3cede7ddc26bd659d2d383b5610efbd2c7a16e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -265,6 +265,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1780902259,
"narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"notewrapper": { "notewrapper": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
+20
View File
@@ -1,5 +1,25 @@
{inputs, ...}: { {inputs, ...}: {
<<<<<<< desktop
flake.homeModules.nix-git-cherry-picker-laptop = {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": "laptop",
"remoteBranch": "desktop",
"nixConfigPath": "/home/tomasr/nixos/"
}
'';
force = true;
};
};
flake.homeModules.nix-git-cherry-picker-desktop = {pkgs, ...}: {
=======
flake.homeModules.nixGitCherryPicker-laptop = {pkgs, ...}: { flake.homeModules.nixGitCherryPicker-laptop = {pkgs, ...}: {
>>>>>>> main
home.packages = [ home.packages = [
inputs.nix-git-cherry-picker.packages.${pkgs.system}.default inputs.nix-git-cherry-picker.packages.${pkgs.system}.default
]; ];