diff --git a/.github/workflows/spdx.yml b/.github/workflows/spdx.yml index 4df41d32bd407a285feddb6030cfcfae213fc55f..4c59e7cb17050c342149c42f135f7b10306049ca 100644 --- a/.github/workflows/spdx.yml +++ b/.github/workflows/spdx.yml @@ -25,16 +25,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd "$GITHUB_WORKSPACE/Library/Homebrew" + git fetch origin master + git reset origin/master + git checkout -B spdx-update if brew update-license-data --fail-if-not-changed; then - if ! git ls-remote --exit-code --heads origin spdx-update; then - git checkout -B spdx-update - git reset origin/master - git add data/spdx - git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." - echo "::set-output name=committed::true" - fi + git add "$GITHUB_WORKSPACE/Library/Homebrew/data/spdx" + git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." + echo "::set-output name=committed::true" fi - name: Push commits @@ -43,11 +41,10 @@ jobs: with: token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} branch: spdx-update + force: true - name: Open a pull request if: steps.update.outputs.committed == 'true' - run: | - cd "$GITHUB_WORKSPACE/Library/Homebrew" - hub pull-request --no-edit + run: hub pull-request --no-edit env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} diff --git a/.github/workflows/tapioca.yml b/.github/workflows/tapioca.yml index 56c24fbb13471936d6d823fca3967410ca782cf7..b5c519fe9e68e14bc2a5768efd998d37b79b6369 100644 --- a/.github/workflows/tapioca.yml +++ b/.github/workflows/tapioca.yml @@ -33,22 +33,20 @@ jobs: - name: Update Tapioca definitions id: update run: | - cd "$GITHUB_WORKSPACE/Library/Homebrew" - git fetch origin master - git reset --hard origin/master + git reset origin/master git checkout -B tapioca-update # TODO: replace with `brew typecheck` + cd "$GITHUB_WORKSPACE/Library/Homebrew" bundle exec tapioca sync --exclude json bundle exec srb rbi hidden-definitions - if ! git diff --no-patch --exit-code -- sorbet; then - if ! git ls-remote --exit-code --heads origin tapioca-update >/dev/null; then - git add sorbet - git commit -m "sorbet: update RBI files using Tapioca." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml)." - echo "::set-output name=committed::true" - fi + + # if brew typecheck --update --fail-if-not-changed; then + git add "$GITHUB_WORKSPACE/Library/Homebrew/sorbet" + git commit -m "sorbet: update RBI files using Tapioca." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml)." + echo "::set-output name=committed::true" fi - name: Push commits @@ -57,6 +55,7 @@ jobs: with: token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} branch: tapioca-update + force: true - name: Open a pull request if: steps.update.outputs.committed == 'true'