Merge pull request #8468 from Homebrew/scheduled-updates
Scheduled workflows fixes
This commit is contained in:
commit
3b3b54728c
15
.github/workflows/spdx.yml
vendored
15
.github/workflows/spdx.yml
vendored
@ -25,17 +25,15 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
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 brew update-license-data --fail-if-not-changed; then
|
||||||
if ! git ls-remote --exit-code --heads origin spdx-update; then
|
git add "$GITHUB_WORKSPACE/Library/Homebrew/data/spdx"
|
||||||
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)."
|
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
|
|
||||||
|
|
||||||
- name: Push commits
|
- name: Push commits
|
||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
@ -43,11 +41,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
branch: spdx-update
|
branch: spdx-update
|
||||||
|
force: true
|
||||||
|
|
||||||
- name: Open a pull request
|
- name: Open a pull request
|
||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
run: |
|
run: hub pull-request --no-edit
|
||||||
cd "$GITHUB_WORKSPACE/Library/Homebrew"
|
|
||||||
hub pull-request --no-edit
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
|
|||||||
13
.github/workflows/tapioca.yml
vendored
13
.github/workflows/tapioca.yml
vendored
@ -33,23 +33,21 @@ jobs:
|
|||||||
- name: Update Tapioca definitions
|
- name: Update Tapioca definitions
|
||||||
id: update
|
id: update
|
||||||
run: |
|
run: |
|
||||||
cd "$GITHUB_WORKSPACE/Library/Homebrew"
|
|
||||||
|
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
git reset --hard origin/master
|
git reset origin/master
|
||||||
git checkout -B tapioca-update
|
git checkout -B tapioca-update
|
||||||
|
|
||||||
# TODO: replace with `brew typecheck`
|
# TODO: replace with `brew typecheck`
|
||||||
|
cd "$GITHUB_WORKSPACE/Library/Homebrew"
|
||||||
bundle exec tapioca sync --exclude json
|
bundle exec tapioca sync --exclude json
|
||||||
bundle exec srb rbi hidden-definitions
|
bundle exec srb rbi hidden-definitions
|
||||||
|
|
||||||
if ! git diff --no-patch --exit-code -- 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
|
# 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)."
|
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
|
|
||||||
|
|
||||||
- name: Push commits
|
- name: Push commits
|
||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
@ -57,6 +55,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
branch: tapioca-update
|
branch: tapioca-update
|
||||||
|
force: true
|
||||||
|
|
||||||
- name: Open a pull request
|
- name: Open a pull request
|
||||||
if: steps.update.outputs.committed == 'true'
|
if: steps.update.outputs.committed == 'true'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user