8000 Update README.md by yonib05 · Pull Request #2 · yonib05/sdk-python · GitHub
[go: up one dir, main page]

Skip to content

Update README.md #2

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
71 changes: 15 additions & 56 deletions .github/workflows/test-lint-pr.yml
8000
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +6,49 @@ on:
types: [opened, synchronize, reopened, ready_for_review, review_requested, review_request_removed]
push:
branches: [ main ] # Also run on direct pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-approval:
name: Check if PR has contributor approval
runs-on: ubuntu-latest
permissions:
pull-requests: read
# Skip this check for direct pushes to main
if: github.event_name == 'pull_request'
outputs:
approved: ${{ steps.check-approval.outputs.approved }}
steps:
- name: Check if PR has been approved by a contributor
id: check-approval
uses: actions/github-script@v7
with:
script: |
const APPROVED_ASSOCIATION = ['COLLABORATOR', 'CONTRIBUTOR', 'MEMBER', 'OWNER']
const PR_AUTHOR_ASSOCIATION = context.payload.pull_request.author_association;
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});

const isApprovedContributor = APPROVED_ASSOCIATION.includes(PR_AUTHOR_ASSOCIATION);

// Check if any contributor has approved
const isApproved = reviews.some(review =>
review.state === 'APPROVED' && APPROVED_ASSOCIATION.includes(review.author_association)
) || isApprovedContributor;

core.setOutput('approved', isApproved);

if (!isApproved) {
core.notice('This PR does not have approval from a Contributor. Workflow will not run test jobs.');
return false;
}

return true;

unit-test:
name: Unit Tests - Python ${{ matrix.python-version }} - ${{ matrix.os-name }}
needs: check-approval
permissions:
contents: read
# Only run if PR is approved or this is a direct push to main
if: github.event_name == 'push' || needs.check-approval.outputs.approved == 'true'
strategy:
matrix:
include:
# Linux
- os: ubuntu-latest
os-name: linux
os-name: 'linux'
python-version: "3.10"
- os: ubuntu-latest
os-name: linux
os-name: 'linux'
python-version: "3.11"
- os: ubuntu-latest
os-name: linux
os-name: 'linux'
python-version: "3.12"
- os: ubuntu-latest
os-name: linux
os-name: 'linux'
python-version: "3.13"
# Windows
- os: windows-latest
os-name: windows
os-name: 'windows'
python-version: "3.10"
- os: windows-latest
os-name: windows
os-name: 'windows'
python-version: "3.11"
- os: windows-latest
os-name: windows
os-name: 'windows'
python-version: "3.12"
- os: windows-latest
os-name: windows
os-name: 'windows'
python-version: "3.13"
# MacOS - latest only; not enough runners for MacOS
# MacOS - latest only; not enough runners for macOS
- os: macos-latest
os-name: macos
python-version: "3.13"
fail-fast: false
os-name: 'macOS'
python-version: "3.13"
fail-fast: true
runs-on: ${{ matrix.os }}
env:
LOG_LEVEL: DEBUG
Expand All @@ -112,10 +73,8 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
needs: check-approval
permissions:
contents: read
if: github.event_name == 'push' || needs.check-approval.outputs.approved == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
test
# Strands Agents

<div align="center">
Expand Down
0