From a9c8077947566a39496d5798a3577b45b59be0e8 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 22 Aug 2020 19:25:17 +0200 Subject: [PATCH 1/3] workflows/tapioca: reset earlier --- .github/workflows/tapioca.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tapioca.yml b/.github/workflows/tapioca.yml index 9685d0b931..85c0f5cef5 100644 --- a/.github/workflows/tapioca.yml +++ b/.github/workflows/tapioca.yml @@ -35,14 +35,16 @@ jobs: run: | cd "$GITHUB_WORKSPACE/Library/Homebrew" + git fetch origin master + git reset --hard origin/master + git checkout -B tapioca-update + # TODO: replace with `brew typecheck` bundle exec tapioca sync --exclude json bundle exec srb rbi hidden-definitions - git fetch origin master - git reset --hard origin/master - git checkout -B tapioca-update git add sorbet + if ! git diff --no-patch --exit-code HEAD -- sorbet; then if ! git ls-remote --exit-code --heads origin tapioca-update >/dev/null; then 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)." From b72ee12e8ee9d3392844ec23f5e5ae7da2bc2351 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 22 Aug 2020 19:31:13 +0200 Subject: [PATCH 2/3] workflows/tapioca: add after diff --- .github/workflows/tapioca.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tapioca.yml b/.github/workflows/tapioca.yml index 85c0f5cef5..3495f0d185 100644 --- a/.github/workflows/tapioca.yml +++ b/.github/workflows/tapioca.yml @@ -43,10 +43,9 @@ jobs: bundle exec tapioca sync --exclude json bundle exec srb rbi hidden-definitions - git add sorbet - if ! git diff --no-patch --exit-code HEAD -- 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 From 0c94fac28c1bf3c5861aa877bef25d764aacb310 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 22 Aug 2020 19:36:41 +0200 Subject: [PATCH 3/3] workflows/tapioca: no HEAD for diff --- .github/workflows/tapioca.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tapioca.yml b/.github/workflows/tapioca.yml index 3495f0d185..56c24fbb13 100644 --- a/.github/workflows/tapioca.yml +++ b/.github/workflows/tapioca.yml @@ -43,7 +43,7 @@ jobs: bundle exec tapioca sync --exclude json bundle exec srb rbi hidden-definitions - if ! git diff --no-patch --exit-code HEAD -- sorbet; then + 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)."