scheduled workflows: fix branch, add new files.

- ensure we reset to `origin/master` so we only have the commit we care
  about in the PR
- ensure we `git add` to include any new files
- don't use `git commit -a` and instead rely only on files added with
  `git add`
This commit is contained in:
Mike McQuaid 2020-08-21 16:50:49 +01:00
parent 755be7a32e
commit 235a663df0
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 7 additions and 3 deletions

View File

@ -30,7 +30,9 @@ jobs:
if brew update-license-data --fail-if-not-changed; then if brew update-license-data --fail-if-not-changed; then
if ! git ls-remote --exit-code --heads origin spdx-update; then if ! git ls-remote --exit-code --heads origin spdx-update; then
git checkout -B spdx-update git checkout -B spdx-update
git commit -am "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." 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" echo "::set-output name=committed::true"
fi fi
fi fi

View File

@ -40,9 +40,11 @@ jobs:
bundle exec srb rbi hidden-definitions bundle exec srb rbi hidden-definitions
git checkout -B tapioca-update git checkout -B tapioca-update
if ! git diff --exit-code -- sorbet; then git reset origin/master
git add sorbet
if ! git --no-patch --exit-code HEAD -- sorbet; then
if ! git ls-remote --exit-code --heads origin tapioca-update; then if ! git ls-remote --exit-code --heads origin tapioca-update; then
git commit -am "sorbet: update RBI files using Tapioca." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml)." 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" echo "::set-output name=committed::true"
fi fi
fi fi