Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Open pull request

on:
push:
branches:
- "**"

permissions:
contents: read

jobs:
open-pull-request:
if: >-
github.ref_type == 'branch' &&
github.ref_name != github.event.repository.default_branch &&
github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Open a pull request for this branch
uses: actions/github-script@v8
with:
script: |
const { owner, repo } = context.repo;
const branch = context.ref.replace(/^refs\/heads\//, "");
const base = context.payload.repository.default_branch;
const existing = await github.rest.pulls.list({
owner,
repo,
state: "open",
head: `${owner}:${branch}`,
base,
per_page: 1,
});

if (existing.data.length > 0) {
core.info(`Pull request #${existing.data[0].number} already exists for ${branch}.`);
return;
}

const commits = context.payload.commits ?? [];
const subjects = commits
.map(({ message }) => message.split(/\r?\n/, 1)[0].trim())
.filter(Boolean);
const latestSubject = context.payload.head_commit?.message
?.split(/\r?\n/, 1)[0]
?.trim();
const title = (latestSubject || `${branch}: automated pull request`).slice(0, 250);
const changes = subjects.length
? subjects.map((subject) => `- ${subject}`).join("\n")
: `- Changes pushed to \`${branch}\`.`;
const body = [
"## What changed?",
"",
changes,
"",
"## Why?",
"",
`Automatically opened for the \`${branch}\` branch. See the commits above for context.`,
"",
"## Validation",
"",
"CI runs automatically on this pull request.",
"",
"## Release impact",
"",
"Review whether package manifests, release assets, or hosted repositories are affected.",
].join("\n");

const pullRequest = await github.rest.pulls.create({
owner,
repo,
head: branch,
base,
title,
body,
draft: false,
});
core.info(`Opened ${pullRequest.data.html_url}`);
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ cargo run -- --fast --name YourName
- Run `cargo fmt`, `cargo test`, and `cargo clippy -- -D warnings`.
- Update the README and changelog when users will notice the change.

Pushing a branch other than the default branch automatically opens a pull request.
Push additional commits to update that pull request; Dependabot branches are excluded.

## Community tip packs

Tip packs are YAML files. Keep them practical, short, original, and safe for a broad developer audience.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ Choose one method. The full platform notes and verification steps are in [docs/i

| Channel | Install | Status |
| --- | --- | --- |
| Arch / AUR | `yay -S yoo-bin` or `paru -S yoo-bin` | Community package |
| APT (Debian/Ubuntu) | `curl -fsSL https://yo-cli.vercel.app/apt/setup.sh \| sudo sh` then `sudo apt install yoo` | Self-hosted signed repository |
| DNF (Fedora/RHEL) | `sudo dnf config-manager addrepo --from-repofile=https://yo-cli.vercel.app/rpm/yoo.repo` then `sudo dnf install yoo` | Self-hosted signed repository |
| Alpine | Add `https://yo-cli.vercel.app/alpine` to `/etc/apk/repositories`, then `sudo apk add yoo` | Self-hosted APK repository |
| openSUSE Tumbleweed | `sudo zypper ar -f https://yo-cli.vercel.app/opensuse yoo && sudo zypper refresh && sudo zypper install yoo` | Self-hosted signed repository |
| Arch / AUR | `yay -S yoo-bin` | Community package |
| Nix | `nix run github:nihitdev/yo-cli` | GitHub flake |
| Flatpak | `flatpak remote-add --user yoo https://yo-cli.vercel.app/flatpak/yoo.flatpakrepo && flatpak install --user yoo io.github.nihitdev.yoo` | Self-hosted repository |
| Cargo Binstall | `cargo binstall yoo` | Prebuilt GitHub Release binary |
Expand Down
1 change: 1 addition & 0 deletions site/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SiteExtras } from "./SiteExtras";
import Image from "next/image";

const installs = [
{ label: "Arch / AUR", command: "yay -S yoo-bin\n# or\nparu -S yoo-bin" },
{ label: "Installer", command: "curl --proto '=https' --tlsv1.2 -LsSf https://yo-cli.vercel.app/yo-setup | sh" },
{ label: "APT", command: "curl -fsSL https://yo-cli.vercel.app/apt/setup.sh | sudo sh\nsudo apt install yoo" },
{ label: "DNF", command: "sudo dnf config-manager addrepo --from-repofile=https://yo-cli.vercel.app/rpm/yoo.repo\nsudo dnf install yoo" },
Expand Down
Loading