From 4d2a19a7286559375fb8f324253730ac46300a4b Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sat, 18 May 2024 11:23:11 +0800 Subject: [PATCH] workflows: fix autosquash We'll be generating commits when autosquashing, so we still need these. Also, let's only generate the build provenance in `create-replacement-pr` whenever we're uploading. --- .github/workflows/create-replacement-pr.yml | 4 ++++ .github/workflows/publish-commit-bottles.yml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/create-replacement-pr.yml b/.github/workflows/create-replacement-pr.yml index acec173e7c9e3..05162044abfc6 100644 --- a/.github/workflows/create-replacement-pr.yml +++ b/.github/workflows/create-replacement-pr.yml @@ -156,6 +156,8 @@ jobs: id: pr-pull working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} env: + BREWTESTBOT_NAME_EMAIL: "BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>" + HOMEBREW_GPG_PASSPHRASE: ${{ inputs.autosquash && secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_CORE_PUBLIC_REPO_EMAIL_TOKEN }} MESSAGE: ${{ inputs.message }} run: | @@ -165,6 +167,7 @@ jobs: --debug \ --branch-okay \ --workflows=tests.yml \ + --committer="$BREWTESTBOT_NAME_EMAIL" \ --root-url="https://ghcr.io/v2/homebrew/core" \ ${{ inputs.autosquash && '--autosquash' || '--clean --no-cherry-pick' }} \ ${{ inputs.message && '--message="$MESSAGE"' || '' }} \ @@ -174,6 +177,7 @@ jobs: uses: actions/attest-build-provenance@v1 with: subject-path: '${{steps.pr-pull.outputs.bottle_path}}/*.tar.gz' + if: inputs.upload - name: Upload bottles to GitHub Packages id: pr-upload diff --git a/.github/workflows/publish-commit-bottles.yml b/.github/workflows/publish-commit-bottles.yml index 4009f5a475f92..d1a92ecdacc84 100644 --- a/.github/workflows/publish-commit-bottles.yml +++ b/.github/workflows/publish-commit-bottles.yml @@ -291,6 +291,8 @@ jobs: id: pr-pull working-directory: ${{steps.set-up-homebrew.outputs.repository-path}} env: + BREWTESTBOT_NAME_EMAIL: "BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>" + HOMEBREW_GPG_PASSPHRASE: ${{ inputs.autosquash && secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_CORE_PUBLIC_REPO_EMAIL_TOKEN}} EXPECTED_SHA: ${{needs.check.outputs.head_sha}} LARGE_RUNNER: ${{inputs.large_runner}} @@ -322,6 +324,7 @@ jobs: --clean \ --no-cherry-pick \ --workflows=tests.yml \ + --committer="$BREWTESTBOT_NAME_EMAIL" \ --root-url="https://ghcr.io/v2/homebrew/core" \ --retain-bottle-dir \ ${{inputs.warn_on_upload_failure && '--warn-on-upload-failure' || ''}} \