-
Notifications
You must be signed in to change notification settings - Fork 961
feat: Return CI test for docker build #977
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
Please make sure all the checkboxes are checked:
|
| name: Build Cognee Backend Docker App Image | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Check out Cognee code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build Cognee Docker image | ||
| id: cognee-docker-tag | ||
| run: | | ||
| export SHA_SHORT="$(git rev-parse --short HEAD)" | ||
| export CUR_DATE="$(date +%Y%m%d%H%M%S)" | ||
| export VERSION="dev-$CUR_DATE-$SHA_SHORT" | ||
| image_name="cognee" docker_login="false" version="$VERSION" account="${{ env.AWS_ACCOUNT_ID_DEV }}" app_dir="." publish="false" ./bin/dockerize | ||
| export DOCKER_TAG=$(cat /tmp/.DOCKER_IMAGE_VERSION) | ||
| echo "Successfully built cognee Docker image. Tag is: $DOCKER_TAG" |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the issue, we need to add a permissions block to the workflow. This block should specify the least privileges required for the workflow to function correctly. Since the workflow checks out code and builds a Docker image, it likely only needs contents: read permission.
The permissions block can be added at the root level of the workflow to apply to all jobs or within the specific job (build_docker) to limit permissions for that job only. In this case, adding it at the root level is sufficient and ensures consistency across all jobs.
-
Copy modified lines R6-R8
| @@ -5,2 +5,5 @@ | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.