generated from roboflow/template-python
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1486 from roboflow/develop
`supervision-0.23.0` release
- Loading branch information
Showing
78 changed files
with
4,440 additions
and
1,608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Notebook Check Pull Request | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
comment-welcome: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch pull request branch | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Fetch base develop branch | ||
run: git fetch -u "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" develop:develop | ||
- name: Create message | ||
env: | ||
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }} | ||
HEAD_REF: ${{ github.event.pull_request.head.ref }} | ||
PR_NUM: ${{ github.event.pull_request.number }} | ||
run: | | ||
# Preview links and tool usage only needed for notebook changes. | ||
readarray -t changed_notebooks < <(git diff --name-only develop | grep '\.ipynb$' || true) | ||
if [[ ${#changed_notebooks[@]} == 0 ]]; then | ||
echo "No notebooks modified in this pull request." | ||
else | ||
msg="<h4>Preview</h4>\n" | ||
msg+="Preview and run these notebook edits with Google Colab:\n<ul>\n" | ||
# Link to PR branch in user's fork that is always current. | ||
for fp in "${changed_notebooks[@]}"; do | ||
gh_path="${HEAD_REPOSITORY}/blob/${HEAD_REF}/${fp}" | ||
colab_url="https://colab.research.google.com/github/${gh_path}" | ||
msg+="<li><a href='${colab_url}'>${fp}</a></li>\n" | ||
done | ||
msg+="</ul>\n" | ||
reviewnb_url="https://app.reviewnb.com/${GITHUB_REPOSITORY}/pull/${PR_NUM}/files/" | ||
msg+="Rendered <a href='${reviewnb_url}'>notebook diffs</a> available on ReviewNB.com.\n" | ||
msg+="If commits are added to the pull request, synchronize your local branch: <code>git pull origin $HEAD_REF</code>\n" | ||
fi | ||
echo "MESSAGE=$msg" >> $GITHUB_ENV | ||
- name: Post comment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE_URL: ${{ github.event.pull_request.issue_url }} | ||
run: | | ||
# Env var defined in previous step. Escape string for JSON. | ||
body="$(echo -n -e $MESSAGE | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')" | ||
# Add comment to pull request. | ||
curl -X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
"${ISSUE_URL}/comments" \ | ||
--data "{\"body\": $body}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--- | ||
comments: true | ||
status: new | ||
--- | ||
|
||
# Datasets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.