Merge pull request #12028 from Homebrew/workflows-pr-fix

workflows: set GITHUB_TOKEN for gh usage
This commit is contained in:
Bo Anderson 2021-09-10 19:57:44 +01:00 committed by GitHub
commit aae8e292f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -32,6 +32,7 @@ jobs:
- name: Update RBI files
id: update
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
run: |
git fetch origin
@ -43,7 +44,7 @@ jobs:
git checkout "$BRANCH"
git reset --hard origin/master
else
git checkout -B "$BRANCH" origin/master
git checkout --no-track -B "$BRANCH" origin/master
fi
if brew typecheck --update --fail-if-not-changed; then
@ -51,7 +52,7 @@ jobs:
git commit -m "sorbet: Update RBI files." \
-m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow."
echo "::set-output name=committed::true"
PULL_REQUEST_STATE=$(gh pr view --json=state)
PULL_REQUEST_STATE=$(gh pr view --json=state | jq -r ".state")
if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then
echo "::set-output name=pull_request::true"
fi

View File

@ -29,6 +29,7 @@ jobs:
- name: Update SPDX license data
id: update
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
run: |
git fetch origin
@ -40,14 +41,14 @@ jobs:
git checkout "$BRANCH"
git reset --hard origin/master
else
git checkout -B "$BRANCH" origin/master
git checkout --no-track -B "$BRANCH" origin/master
fi
if brew update-license-data --fail-if-not-changed; then
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"
PULL_REQUEST_STATE=$(gh pr view --json=state)
PULL_REQUEST_STATE=$(gh pr view --json=state | jq -r ".state")
if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then
echo "::set-output name=pull_request::true"
fi

View File

@ -48,7 +48,7 @@ jobs:
git checkout "$BRANCH"
git reset --hard origin/master
else
git checkout -B "$BRANCH" origin/master
git checkout --no-track -B "$BRANCH" origin/master
fi
if [ "${{github.event_name}}" != "push" ]; then
@ -63,12 +63,13 @@ jobs:
git commit -m "Update maintainers, manpage and completions." \
-m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/update-man-completions.yml) workflow."
echo "::set-output name=committed::true"
PULL_REQUEST_STATE=$(gh pr view --json=state)
PULL_REQUEST_STATE=$(gh pr view --json=state | jq -r ".state")
if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then
echo "::set-output name=pull_request::true"
fi
fi
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_BREW_UPDATE_MAINTAINERS_TOKEN }}
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}