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

Ultralytics CLA Action #252

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b8898cf
Ultralytics CLA Action
UltralyticsAssistant Oct 20, 2024
a892cae
Ultralytics CLA Action
UltralyticsAssistant Oct 20, 2024
0632ac5
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Oct 20, 2024
02b94d7
Update action.yml
glenn-jocher Oct 21, 2024
68efcb7
Merge branch 'main' into cla-branch
glenn-jocher Oct 21, 2024
0c12b0f
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Oct 21, 2024
e13f5b9
Simplify Actions
UltralyticsAssistant Oct 21, 2024
62d31c0
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Oct 21, 2024
4e5b295
Simplify Actions
UltralyticsAssistant Oct 21, 2024
c68104a
Simplify Actions
UltralyticsAssistant Oct 21, 2024
1395196
Simplify Actions
UltralyticsAssistant Oct 21, 2024
5eb4caa
Simplify Actions
UltralyticsAssistant Oct 21, 2024
dfb9b60
Simplify Actions
UltralyticsAssistant Oct 21, 2024
b56f11b
Merge branch 'main' into cla-branch
glenn-jocher Oct 21, 2024
7705f58
Update action.yml
glenn-jocher Oct 21, 2024
0534a9e
Merge branch 'main' into cla-branch
glenn-jocher Oct 21, 2024
9255e68
Merge branch 'main' into cla-branch
glenn-jocher Oct 23, 2024
c1c2b12
Merge branch 'main' into cla-branch
glenn-jocher Oct 26, 2024
6fc2263
Update action.yml
glenn-jocher Oct 27, 2024
5cf3b37
Merge branch 'main' into cla-branch
glenn-jocher Oct 27, 2024
b8eca82
Merge branch 'main' into cla-branch
glenn-jocher Nov 7, 2024
cc6dba1
Merge branch 'main' into cla-branch
glenn-jocher Nov 18, 2024
f5c49f7
Update action.yml
glenn-jocher Nov 18, 2024
ebe6a4a
Merge branch 'main' into cla-branch
glenn-jocher Nov 19, 2024
deb279f
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Nov 19, 2024
3c2ee16
Merge branch 'main' into cla-branch
glenn-jocher Nov 21, 2024
f36e315
Merge branch 'main' into cla-branch
glenn-jocher Nov 21, 2024
8f4198b
Merge branch 'main' into cla-branch
glenn-jocher Nov 26, 2024
23ceca5
Merge branch 'main' into cla-branch
UltralyticsAssistant Dec 5, 2024
bf9385d
Merge branch 'main' into cla-branch
glenn-jocher Dec 8, 2024
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
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ runs:
- name: Install Dependencies
# Note tomli required for codespell with pyproject.toml
# For debug:
# python -m pip install --upgrade pip wheel
# pip install -q git+https://github.com/ultralytics/actions@main codespell tomli
env:
INPUTS_SPELLING: ${{ inputs.spelling }}
run: |
packages="ultralytics-actions"
packages="ultralytics_actions"
# For debug
packages="git+https://github.com/ultralytics/actions@cla-branch"
if [ "$INPUTS_SPELLING" = "true" ]; then
packages="$packages codespell tomli"
fi
Expand All @@ -84,7 +85,7 @@ runs:
if [ "$(uname)" = "Darwin" ]; then
pip install -q $packages
else
sudo env "PATH=$PATH" uv pip install --system $packages
sudo env "PATH=$PATH" uv pip install codespell tomli
fi

ultralytics-actions-info
Expand Down
23 changes: 23 additions & 0 deletions actions/check_cla.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os


def main():
print("RUNNING CHECK_CLA FUNCTION")
os.environ.get("GITHUB_TOKEN")
os.environ.get("CLA_REPOSITORY")
os.environ.get("CLA_BRANCH")
os.environ.get("CLA_SIGNATURES_PATH")
os.environ.get("CLA_DOCUMENT_URL")
os.environ.get("ALLOWLIST", "").split(",")
os.environ.get("SIGN_COMMENT")
os.environ.get("ALLSIGNED_COMMENT")

# Your CLA check logic here
# Note: You can extract the organization and repository name if needed:
# org, repo = cla_repository.split('/', 1) if '/' in cla_repository else ('', cla_repository)

# ... rest of your CLA check logic ...


if __name__ == "__main__":
main()
76 changes: 76 additions & 0 deletions cla/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Ultralytics Actions πŸš€, AGPL-3.0 License https://ultralytics.com/license

name: "Ultralytics CLA"
description: "Checks if contributors have signed the Ultralytics Contributor License Agreement"
inputs:
github-token:
description: "GitHub token"
required: true
cla_repository:
description: "GitHub repository name for storing CLA signatures (including organization, e.g., 'org/repo')"
required: true
cla_branch:
description: "Branch to store CLA signatures"
required: true
default: "cla-signatures"
cla_signatures_path:
description: "Path to the JSON file containing CLA signatures"
required: true
default: "signatures/version1/cla.json"
cla_document_url:
description: "URL to the CLA document"
required: true
default: "https://docs.ultralytics.com/help/CLA"
allowlist:
description: "Comma-separated list of users/bots to ignore"
required: false
default: "dependabot[bot],github-actions,bot*"
sign_comment:
description: "Comment to trigger CLA signing"
required: true
default: "I have read the CLA Document and I sign the CLA"
allsigned_comment:
description: "Comment to post when all contributors have signed"
required: true
default: "All Contributors have signed the CLA. βœ…"
openai_api_key:
description: "OpenAI API Key"
required: false
openai_model:
description: "OpenAI Model"
required: false
default: "gpt-4o"

runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -q git+https://github.com/ultralytics/actions@cla-branch
# pip install -q ultralytics-actions
ultralytics-actions-info
shell: bash

- name: Check CLA
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
CLA_REPOSITORY: ${{ inputs.cla_repository }}
CLA_BRANCH: ${{ inputs.cla_branch }}
CLA_SIGNATURES_PATH: ${{ inputs.cla_signatures_path }}
CLA_DOCUMENT_URL: ${{ inputs.cla_document_url }}
ALLOWLIST: ${{ inputs.allowlist }}
SIGN_COMMENT: ${{ inputs.sign_comment }}
ALLSIGNED_COMMENT: ${{ inputs.allsigned_comment }}
OPENAI_API_KEY: ${{ inputs.openai_api_key }}
OPENAI_MODEL: ${{ inputs.openai_model }}
run: ultralytics-actions-check-cla
shell: bash
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ ultralytics-actions-summarize-pr = "actions.summarize_pr:main"
ultralytics-actions-summarize-release = "actions.summarize_release:main"
ultralytics-actions-update-markdown-code-blocks = "actions.update_markdown_code_blocks:main"
ultralytics-actions-info = "actions.utils:ultralytics_actions_info"
ultralytics-actions-check-cla = "actions.check_cla:main"

[tool.setuptools]
packages = { find = { where = ["."], include = ["actions", "actions.*"] } }
Expand Down
Loading