Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows/scheduled: add bottle attestation check #192686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:

DAYS_PER_YEAR=365
if (( formulae_count > DAYS_PER_YEAR * TEST_COUNT )); then
echo "::error ::Too many formulae (${formulae_count})! Adjust TEST_COUNT to a number greater than ${TEST_COUNT}."
required_test_count="$(( formulae_count / DAYS_PER_YEAR + 1 ))"
echo "::error ::Too many formulae (${formulae_count})! Adjust TEST_COUNT to a number greater than ${required_test_count}."
exit 1
fi

Expand Down Expand Up @@ -152,3 +153,27 @@ jobs:
gh issue comment "$REPORTING_ISSUE" \
--body "$FORMULA source has problems. Check $RUN_URL" \
--repo "$GITHUB_REPOSITORY"

- name: Check bottle attestation
id: attestation
if: always()
shell: brew ruby {0}
env:
HOMEBREW_FORMULA: ${{ matrix.formula }}
run: |
require "attestation"
formula = Formulary.factory(ENV.fetch("HOMEBREW_FORMULA"))
bottle = formula.bottle

# TODO: Check attestations for all os-arch variations
exit 0 if bottle.blank?

bottle.fetch
Homebrew::Attestation.check_core_attestation(bottle)

- name: Report attestation issues
if: failure() && steps.attestation.conclusion == 'failure'
run: |
gh issue comment "$REPORTING_ISSUE" \
--body "$FORMULA attestation has problems. Check $RUN_URL" \
--repo "$GITHUB_REPOSITORY"
Loading