From bf6145005058962cbdff40bf20fa7775763361c4 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 19 Jun 2026 09:16:11 -0400 Subject: [PATCH 1/3] bump-packages: support full package names Signed-off-by: Rui Chen --- bump-packages/README.md | 2 ++ bump-packages/action.test.mts | 30 ++++++++++++++++++++++++++++++ bump-packages/action.yml | 32 ++++++++++++++++++++++---------- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/bump-packages/README.md b/bump-packages/README.md index 7ce3dc4e..72afaddf 100644 --- a/bump-packages/README.md +++ b/bump-packages/README.md @@ -31,4 +31,6 @@ If there are no outdated packages, the Action will just exit. ... # Do not use a fork for opening PR's fork: false + # Package names are fully-qualified, e.g. user/tap/formula + full-name: true ``` diff --git a/bump-packages/action.test.mts b/bump-packages/action.test.mts index 54a07380..59026fed 100644 --- a/bump-packages/action.test.mts +++ b/bump-packages/action.test.mts @@ -75,6 +75,21 @@ describe("bump-packages action", () => { ]); }); + it("bumps fully-qualified formulae with --full-name", () => { + assert.deepEqual(brewBumpArgs("Bump formulae", { + INPUT_FORMULAE: "user/tap/foo", + INPUT_FORK: "false", + INPUT_FULL_NAME: "true", + }), [ + "bump", + "--no-fork", + "--full-name", + "--open-pr", + "--formulae", + "user/tap/foo", + ]); + }); + it("bumps casks with --no-fork when not using a fork", () => { assert.deepEqual(brewBumpArgs("Bump casks", { INPUT_CASKS: "baz qux", INPUT_FORK: "false" }), [ "bump", @@ -85,4 +100,19 @@ describe("bump-packages action", () => { "qux", ]); }); + + it("bumps fully-qualified casks with --full-name", () => { + assert.deepEqual(brewBumpArgs("Bump casks", { + INPUT_CASKS: "user/tap/baz", + INPUT_FORK: "false", + INPUT_FULL_NAME: "true", + }), [ + "bump", + "--no-fork", + "--full-name", + "--open-pr", + "--casks", + "user/tap/baz", + ]); + }); }); diff --git a/bump-packages/action.yml b/bump-packages/action.yml index ad3ebadb..a179d1d6 100644 --- a/bump-packages/action.yml +++ b/bump-packages/action.yml @@ -20,6 +20,10 @@ inputs: description: Use a fork when opening a PR required: false default: ${{ github.repository_owner != 'Homebrew' }} + full-name: + description: Pass fully-qualified package names to brew bump + required: false + default: 'false' runs: using: composite steps: @@ -30,33 +34,41 @@ runs: - name: Bump formulae run: | - if [[ "$INPUT_FORK" == "true" ]]; then - NO_FORK="" - else - NO_FORK="--no-fork" + args=(bump) + if [[ "$INPUT_FORK" != "true" ]]; then + args+=(--no-fork) + fi + if [[ "$INPUT_FULL_NAME" == "true" ]]; then + args+=(--full-name) fi + args+=(--open-pr) IFS=" " read -r -a formulae <<<"${INPUT_FORMULAE}" - brew bump $NO_FORK --open-pr --formulae "${formulae[@]}" + brew "${args[@]}" --formulae "${formulae[@]}" shell: bash if: inputs.formulae != '' env: INPUT_FORMULAE: ${{ inputs.formulae }} INPUT_FORK: ${{ inputs.fork }} + INPUT_FULL_NAME: ${{ inputs.full-name }} HOMEBREW_DEVELOPER: "1" HOMEBREW_GITHUB_API_TOKEN: ${{ inputs.token }} - name: Bump casks run: | - if [[ "$INPUT_FORK" == "true" ]]; then - NO_FORK="" - else - NO_FORK="--no-fork" + args=(bump) + if [[ "$INPUT_FORK" != "true" ]]; then + args+=(--no-fork) + fi + if [[ "$INPUT_FULL_NAME" == "true" ]]; then + args+=(--full-name) fi + args+=(--open-pr) IFS=" " read -r -a casks <<<"${INPUT_CASKS}" - brew bump $NO_FORK --open-pr --casks "${casks[@]}" + brew "${args[@]}" --casks "${casks[@]}" shell: bash if: inputs.casks != '' env: INPUT_CASKS: ${{ inputs.casks }} INPUT_FORK: ${{ inputs.fork }} + INPUT_FULL_NAME: ${{ inputs.full-name }} HOMEBREW_DEVELOPER: "1" HOMEBREW_GITHUB_API_TOKEN: ${{ inputs.token }} From 264d3660e93102274637fe59e2063099550117ce Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 19 Jun 2026 17:16:59 -0400 Subject: [PATCH 2/3] bump-packages: adopt pr feedback Co-authored-by: Carlo Cabrera --- bump-packages/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bump-packages/action.yml b/bump-packages/action.yml index a179d1d6..755fabc6 100644 --- a/bump-packages/action.yml +++ b/bump-packages/action.yml @@ -43,7 +43,7 @@ runs: fi args+=(--open-pr) IFS=" " read -r -a formulae <<<"${INPUT_FORMULAE}" - brew "${args[@]}" --formulae "${formulae[@]}" + brew bump "${args[@]}" --formulae "${formulae[@]}" shell: bash if: inputs.formulae != '' env: From af1e99f100a2dae8854ce1ac63aec769265f0425 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 19 Jun 2026 17:24:35 -0400 Subject: [PATCH 3/3] bump-packages: auto-detect full package names Signed-off-by: Rui Chen --- bump-packages/README.md | 3 ++- bump-packages/action.test.mts | 36 +++++++++++++++++++++++++++++++---- bump-packages/action.yml | 16 ++++++++-------- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/bump-packages/README.md b/bump-packages/README.md index 72afaddf..d401d5cc 100644 --- a/bump-packages/README.md +++ b/bump-packages/README.md @@ -31,6 +31,7 @@ If there are no outdated packages, the Action will just exit. ... # Do not use a fork for opening PR's fork: false - # Package names are fully-qualified, e.g. user/tap/formula + # Fully-qualified names, e.g. user/tap/formula, are detected automatically. + # Set this to force --full-name for short names too. full-name: true ``` diff --git a/bump-packages/action.test.mts b/bump-packages/action.test.mts index 59026fed..dafb4388 100644 --- a/bump-packages/action.test.mts +++ b/bump-packages/action.test.mts @@ -75,11 +75,10 @@ describe("bump-packages action", () => { ]); }); - it("bumps fully-qualified formulae with --full-name", () => { + it("bumps fully-qualified formulae with --full-name automatically", () => { assert.deepEqual(brewBumpArgs("Bump formulae", { INPUT_FORMULAE: "user/tap/foo", INPUT_FORK: "false", - INPUT_FULL_NAME: "true", }), [ "bump", "--no-fork", @@ -90,6 +89,21 @@ describe("bump-packages action", () => { ]); }); + it("forces --full-name for short formula names", () => { + assert.deepEqual(brewBumpArgs("Bump formulae", { + INPUT_FORMULAE: "foo", + INPUT_FORK: "false", + INPUT_FULL_NAME: "true", + }), [ + "bump", + "--no-fork", + "--full-name", + "--open-pr", + "--formulae", + "foo", + ]); + }); + it("bumps casks with --no-fork when not using a fork", () => { assert.deepEqual(brewBumpArgs("Bump casks", { INPUT_CASKS: "baz qux", INPUT_FORK: "false" }), [ "bump", @@ -101,11 +115,10 @@ describe("bump-packages action", () => { ]); }); - it("bumps fully-qualified casks with --full-name", () => { + it("bumps fully-qualified casks with --full-name automatically", () => { assert.deepEqual(brewBumpArgs("Bump casks", { INPUT_CASKS: "user/tap/baz", INPUT_FORK: "false", - INPUT_FULL_NAME: "true", }), [ "bump", "--no-fork", @@ -115,4 +128,19 @@ describe("bump-packages action", () => { "user/tap/baz", ]); }); + + it("forces --full-name for short cask names", () => { + assert.deepEqual(brewBumpArgs("Bump casks", { + INPUT_CASKS: "baz", + INPUT_FORK: "false", + INPUT_FULL_NAME: "true", + }), [ + "bump", + "--no-fork", + "--full-name", + "--open-pr", + "--casks", + "baz", + ]); + }); }); diff --git a/bump-packages/action.yml b/bump-packages/action.yml index 755fabc6..8085ffc7 100644 --- a/bump-packages/action.yml +++ b/bump-packages/action.yml @@ -21,7 +21,7 @@ inputs: required: false default: ${{ github.repository_owner != 'Homebrew' }} full-name: - description: Pass fully-qualified package names to brew bump + description: Force fully-qualified package names to brew bump required: false default: 'false' runs: @@ -34,15 +34,15 @@ runs: - name: Bump formulae run: | - args=(bump) + args=() if [[ "$INPUT_FORK" != "true" ]]; then args+=(--no-fork) fi - if [[ "$INPUT_FULL_NAME" == "true" ]]; then + IFS=" " read -r -a formulae <<<"${INPUT_FORMULAE}" + if [[ "$INPUT_FULL_NAME" == "true" || "${formulae[*]}" == */* ]]; then args+=(--full-name) fi args+=(--open-pr) - IFS=" " read -r -a formulae <<<"${INPUT_FORMULAE}" brew bump "${args[@]}" --formulae "${formulae[@]}" shell: bash if: inputs.formulae != '' @@ -54,16 +54,16 @@ runs: HOMEBREW_GITHUB_API_TOKEN: ${{ inputs.token }} - name: Bump casks run: | - args=(bump) + args=() if [[ "$INPUT_FORK" != "true" ]]; then args+=(--no-fork) fi - if [[ "$INPUT_FULL_NAME" == "true" ]]; then + IFS=" " read -r -a casks <<<"${INPUT_CASKS}" + if [[ "$INPUT_FULL_NAME" == "true" || "${casks[*]}" == */* ]]; then args+=(--full-name) fi args+=(--open-pr) - IFS=" " read -r -a casks <<<"${INPUT_CASKS}" - brew "${args[@]}" --casks "${casks[@]}" + brew bump "${args[@]}" --casks "${casks[@]}" shell: bash if: inputs.casks != '' env: