Skip to content

Commit

Permalink
workflows: improve style
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed Jun 9, 2023
1 parent 9c4e2ef commit 476368d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-replacement-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
gh api \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"repos/$GH_REPO/pulls/$PR/reviews"
"repos/{owner}/{repo}/pulls/$PR/reviews"
)"
reviewers="$(jq --compact-output '[.[].user.login]' <<< "$review_data")"
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/publish-commit-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:

env:
PR: ${{inputs.pull_request}}
AUTOSQUASH: ${{ inputs.autosquash }}
INPUT_MESSAGE: ${{ inputs.message }}
GNUPGHOME: /tmp/gnupghome
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
Expand All @@ -42,10 +42,10 @@ env:
GH_NO_UPDATE_NOTIFIER: 1
GH_PROMPT_DISABLED: 1
RUN_URL: ${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}
NON_PUSHABLE_MESSAGE: >
NON_PUSHABLE_MESSAGE: >-
:no_entry: It looks like @BrewTestBot cannot push to your PR branch. For future pull requests, please
[allow maintainers to edit your PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to simplify the merge process.
ORG_FORK_MESSAGE: >
ORG_FORK_MESSAGE: >-
:no_entry: It looks like @BrewTestBot cannot push to your PR branch. Please open
future pull requests from a non-organization fork to simplify the merge process.
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
echo "remote_branch=$remote_branch"
echo "remote=$remote"
echo "node_id=$node_id"
echo "replace=$AUTOSQUASH"
echo "replace=${{ inputs.autosquash }}"
} >> "$GITHUB_OUTPUT"
if "$pushable" && [[ "$fork_type" != "Organization" ]] ||
Expand All @@ -185,15 +185,14 @@ jobs:
fromJson(steps.pr-branch-check.outputs.bottles)
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
MESSAGE: ${{ inputs.message }}
run: |
gh workflow run create-replacement-pr.yml \
--ref "$GITHUB_REF_NAME" \
--field pull_request="$PR" \
--field autosquash="$AUTOSQUASH" \
--field autosquash='${{ inputs.autosquash }}' \
--field upload='${{ !inputs.autosquash }}' \
--field warn_on_upload_failure=false \
--field message="$MESSAGE"
--field message="$INPUT_MESSAGE"
- name: Post comment on failure
if: ${{!success()}}
Expand Down Expand Up @@ -282,7 +281,6 @@ jobs:
HOMEBREW_GITHUB_PACKAGES_USER: brewtestbot
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{secrets.HOMEBREW_CORE_GITHUB_PACKAGES_TOKEN}}
EXPECTED_SHA: ${{needs.check.outputs.head_sha}}
MESSAGE: ${{inputs.message}}
run: |
local_git_head="$(git rev-parse HEAD)"
remote_git_head="$(git ls-remote origin "pull/$PR/head" | cut -f1)"
Expand All @@ -306,7 +304,7 @@ jobs:
--committer="$BREWTESTBOT_NAME_EMAIL" \
--root-url="https://ghcr.io/v2/homebrew/core" \
${{inputs.warn_on_upload_failure && '--warn-on-upload-failure' || ''}} \
${{inputs.message && '--message="$MESSAGE"' || ''}} \
${{inputs.message && '--message="$INPUT_MESSAGE"' || ''}} \
"$PR"
echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 476368d

Please sign in to comment.