-
Notifications
You must be signed in to change notification settings - Fork 4
ci(sdk): fix branch parsing for integ framework #189
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
Conversation
| ' \ | ||
| | head -n1 \ | ||
| | tr -d "\r" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: make/use a python script rather than bash :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are funny :D
| print(f"Using testing SDK branch: {ref}") | ||
| PYTHON | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could live as a script in the ops/ dir - easier to test there :-)
0d00570 to
e31155c
Compare
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Run parser tests | ||
| run: python ops/__tests__/test_parse_sdk_branch.py |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix this problem, add a permissions key to your workflow file, restricting the GITHUB_TOKEN privileges. Place this key either at the root, affecting all jobs, or under the relevant job. In this case, since only one job exists, it's simplest and clearest to place it at the workflow root (right after the name: and before on:), specifying minimal permissions. A starting point is contents: read, which covers checking out code. If your workflow or job needs additional permissions, you can add them as needed. For this workflow, which just checks out code and runs a Python test file, this minimal set appears sufficient. Add:
permissions:
contents: readright after the name: field and before on:.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Test Parser | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
Updated the script to safely parse the testing SDK branch from the PR body, handling case insensitivity and whitespace.
The goal here is to fix the usage of backticks such as in
foo, and contractions that we've been using such aswe'veTESTING_SDK_BRANCH = main
fixes: #118
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.