diff --git a/.github/workflows/sponsors-maintainers-man-completions.yml b/.github/workflows/maintainers-man-completions.yml similarity index 82% rename from .github/workflows/sponsors-maintainers-man-completions.yml rename to .github/workflows/maintainers-man-completions.yml index 38b1f9f62a..b01c18bfc6 100644 --- a/.github/workflows/sponsors-maintainers-man-completions.yml +++ b/.github/workflows/maintainers-man-completions.yml @@ -1,9 +1,9 @@ -name: Update sponsors, maintainers, manpage and completions +name: Update maintainers, manpage and completions on: push: paths: - - .github/workflows/sponsors-maintainers-man-completions.yml + - .github/workflows/maintainers-man-completions.yml - README.md - Library/Homebrew/cmd/** - Library/Homebrew/dev-cmd/** @@ -12,8 +12,6 @@ on: - Library/Homebrew/cli/parser.rb - Library/Homebrew/completions.rb - Library/Homebrew/env_config.rb - branches: - - master schedule: - cron: "0 0 * * *" workflow_dispatch: @@ -27,6 +25,7 @@ jobs: if: github.repository == 'Homebrew/brew' steps: - name: Setup Homebrew + id: set-up-homebrew uses: Homebrew/actions/setup-homebrew@master - name: Configure Git user @@ -39,12 +38,24 @@ jobs: with: signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} - - name: Update sponsors, maintainers, manpage and completions + - name: Cache Bundler RubyGems + uses: actions/cache@v1 + with: + path: ${{ steps.set-up-homebrew.outputs.gems-path }} + key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} + restore-keys: ${{ runner.os }}-rubygems- + + - name: Update maintainers, manpage and completions id: update run: | git fetch origin - BRANCH=sponsors-maintainers-man-completions + if [[ -n "$GITHUB_REF_NAME" && "$GITHUB_REF_NAME" != "master" ]] + then + BRANCH="$GITHUB_REF_NAME" + else + BRANCH=maintainers-man-completions + fi echo "::set-output name=branch::${BRANCH}" if git ls-remote --exit-code --heads origin "${BRANCH}" @@ -64,15 +75,7 @@ jobs: "${GITHUB_WORKSPACE}/docs/Manpage.md" \ "${GITHUB_WORKSPACE}/manpages/brew.1" git commit -m "Update maintainers." \ - -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." - COMMITTED=true - fi - - if brew update-sponsors - then - git add "${GITHUB_WORKSPACE}/README.md" - git commit -m "Update sponsors." \ - -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." + -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/maintainers-man-completions.yml) workflow." COMMITTED=true fi @@ -83,7 +86,7 @@ jobs: "${GITHUB_WORKSPACE}/manpages/brew.1" \ "${GITHUB_WORKSPACE}/completions" git commit -m "Update manpage and completions." \ - -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow." + -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/maintainers-man-completions.yml) workflow." COMMITTED=true fi diff --git a/.github/workflows/spdx.yml b/.github/workflows/spdx.yml index 7d0a093f72..57e004500e 100644 --- a/.github/workflows/spdx.yml +++ b/.github/workflows/spdx.yml @@ -7,8 +7,11 @@ on: - master schedule: - cron: "0 0 * * *" + workflow_dispatch: + permissions: contents: read + jobs: spdx: if: github.repository == 'Homebrew/brew'