-
Notifications
You must be signed in to change notification settings - Fork 211
Add V2 objects.inv workflow #1435
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
doctorperceptron
wants to merge
9
commits into
master
Choose a base branch
from
add-objects-inventory-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+104
−0
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9cf7b55
Don't track sphinx output.
doctorperceptron 7b4260b
Build objects.inv file
doctorperceptron f54f10b
Add secrets
doctorperceptron c493db9
Add todo
doctorperceptron 5c3e6e9
Add dedicated objects.inv workflow
doctorperceptron 7f85f47
Update swc-env workflow
doctorperceptron 31e3e5b
force build
doctorperceptron eb0b69c
Fix typo
doctorperceptron 68734d4
Fix typo
doctorperceptron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,69 @@ | ||
name: V2 Sync objects.inv | ||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
description: The QML branch that is being built. | ||
type: string | ||
required: true | ||
dev: | ||
description: Use development dependencies. | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
secrets: | ||
aws_region: | ||
description: The AWS Region the infrastructure resides in | ||
required: true | ||
aws_access_key_id: | ||
description: AWS Access Key to use when accessing the S3 bucket | ||
required: true | ||
aws_secret_access_key: | ||
description: AWS Secret Access Key to use when accessing the S3 bucket | ||
required: true | ||
aws_html_s3_bucket_id: | ||
description: The S3 bucket ID where the objects.inv file will be pushed | ||
required: true | ||
|
||
|
||
jobs: | ||
build-and-upload: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_REGION: ${{ secrets.aws_region }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} | ||
AWS_S3_HTML_BUCKET_ID: ${{ secrets.aws_html_s3_bucket_id }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
fetch-depth: 1 | ||
|
||
- name: Install pandoc and opencl | ||
run: | | ||
sudo apt-get install -y \ | ||
ocl-icd-opencl-dev \ | ||
pandoc | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: pip install . && poetry config warnings.export false | ||
|
||
- name: Build all demos in HTML format | ||
run: | | ||
qml build \ | ||
--format html \ | ||
--keep-going \ | ||
--no-quiet \ | ||
${{ inputs.dev && '--dev' || '--no-dev' }} | ||
|
||
- name: Sync objects.inv to HTML Bucket | ||
run: aws s3 cp ./_build/objects.inv s3://$AWS_S3_HTML_BUCKET_ID/qml/objects.inv | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 days ago
To fix this issue, we need to explicitly define the
permissions
key at the workflow level to limit theGITHUB_TOKEN
permissions. From the workflow's logic, it primarily interacts with AWS and performs build processes, which do not require GitHub API write permissions. Thecontents
permission can be set toread
since the workflow checks out the repository contents. No other GitHub API permissions appear necessary.The fix involves adding a
permissions
block at the root of the workflow file (before thejobs
block). This ensures that all jobs in the workflow inherit these minimal permissions unless overridden.