diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index a5b7db742b..0000000000 --- a/.github/main.workflow +++ /dev/null @@ -1,10 +0,0 @@ -workflow "Push" { - on = "push" - resolves = ["Generate rubydoc.brew.sh"] -} - -action "Generate rubydoc.brew.sh" { - uses = "docker://ruby:latest" - runs = ".github/main.workflow.sh" - secrets = ["RUBYDOC_DEPLOY_KEY"] -} diff --git a/.github/main.workflow.sh b/.github/main.workflow.sh deleted file mode 100755 index 396b8bafd4..0000000000 --- a/.github/main.workflow.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -set -e - -# silence bundler complaining about being root -mkdir ~/.bundle -echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config - -# configure git -git config --global user.name "BrewTestBot" -git config --global user.email "homebrew-test-bot@lists.sfconservancy.org" - -# setup SSH -mkdir ~/.ssh -chmod 700 ~/.ssh -echo "$RUBYDOC_DEPLOY_KEY" > ~/.ssh/id_ed25519 -chmod 600 ~/.ssh/id_ed25519 -git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - -# clone rubydoc.brew.sh with SSH so we can push back -git clone git@github.com:Homebrew/rubydoc.brew.sh -cd rubydoc.brew.sh - -# clone latest Homebrew/brew -git clone --depth=1 https://github.com/Homebrew/brew - -# run rake to build documentation -gem install bundler -bundle install -bundle exec rake - -# commit and push generated files -git add docs -git diff --exit-code HEAD -- docs && exit 0 -git commit -m 'docs: update from Homebrew/brew push' docs -git push diff --git a/.github/workflows/apidoc.yml b/.github/workflows/apidoc.yml new file mode 100644 index 0000000000..5ec923140e --- /dev/null +++ b/.github/workflows/apidoc.yml @@ -0,0 +1,38 @@ +name: Generate rubydoc.brew.sh +on: + push: + branches: master +jobs: + apidoc: + runs-on: ubuntu-latest + steps: + - uses: docker://ruby:latest + - uses: Homebrew/actions/git-ssh@master + with: + git_user: BrewTestBot + git_email: homebrew-test-bot@lists.sfconservancy.org + key: ${{ secrets.RUBYDOC_DEPLOY_KEY }} + - run: | + # silence bundler complaining about being root + mkdir ~/.bundle + echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config + + # clone rubydoc.brew.sh with SSH so we can push back + git clone git@github.com:Homebrew/rubydoc.brew.sh + cd rubydoc.brew.sh + + # clone latest Homebrew/brew + git clone --depth=1 https://github.com/Homebrew/brew + + # run rake to build documentation + gem install bundler + bundle install + bundle exec rake + + # commit and push generated files + git add docs + + if ! git diff --exit-code HEAD -- docs; then + git commit -m 'docs: update from Homebrew/brew push' docs + git push + fi diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index 687bc03c62..1aa9471400 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require "formula" -require "cli/parser" - # `brew uses foo bar` returns formulae that use both foo and bar # If you want the union, run the command twice and concatenate the results. # The intersection is harder to achieve with shell tools. +require "formula" +require "cli/parser" + module Homebrew module_function