-
Notifications
You must be signed in to change notification settings - Fork 273
ci: build docker image on PRs / tags #2353
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,8 +3,42 @@ | ||||||||||||||||
| name: Tests / Code Coverage | |||||||||||||||||
| on: | |||||||||||||||||
| workflow_call: | |||||||||||||||||
| inputs: | |||||||||||||||||
| image-tag: | |||||||||||||||||
| required: true | |||||||||||||||||
| type: string | |||||||||||||||||
|
|
|||||||||||||||||
| jobs: | |||||||||||||||||
| build-docker-image: | |||||||||||||||||
| name: Build Docker Image | |||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||
| steps: | |||||||||||||||||
| - name: Checkout code | |||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||
|
|
|||||||||||||||||
| - name: Set up Docker Buildx | |||||||||||||||||
| uses: docker/setup-buildx-action@v3 | |||||||||||||||||
|
|
|||||||||||||||||
| - name: Log in to GHCR | |||||||||||||||||
| uses: docker/login-action@v3 | |||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step [Uses Step](1) uses 'docker/login-action' with ref 'v3', not a pinned commit hash
|
|||||||||||||||||
| with: | |||||||||||||||||
| registry: ghcr.io | |||||||||||||||||
| username: ${{ github.actor }} | |||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | |||||||||||||||||
|
|
|||||||||||||||||
| - name: Build and push Docker image with PR tag | |||||||||||||||||
| uses: docker/build-push-action@v5 | |||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step [Uses Step](1) uses 'docker/build-push-action' with ref 'v5', not a pinned commit hash
|
|||||||||||||||||
| with: | |||||||||||||||||
| context: . | |||||||||||||||||
| push: true | |||||||||||||||||
| tags: ghcr.io/${{ github.repository_owner }}/rollkit:${{ inputs.image-tag }} | |||||||||||||||||
|
|
|||||||||||||||||
| upgrade-tests: | |||||||||||||||||
|
Comment on lines
+13
to
+36
Check warningCode scanning / CodeQL Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Copilot AutofixAI about 1 year ago To fix the issue, we need to add a
The
Suggested changeset
1
.github/workflows/test.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment on lines
+13
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add explicit permissions block for least-privilege 🧰 Tools🪛 GitHub Check: CodeQL[warning] 13-36: Workflow does not contain permissions [warning] 20-20: Unpinned tag for a non-immutable Action in workflow [warning] 23-23: Unpinned tag for a non-immutable Action in workflow [warning] 30-30: Unpinned tag for a non-immutable Action in workflow 🤖 Prompt for AI Agents |
|||||||||||||||||
| needs: build-docker-image | |||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||
| steps: | |||||||||||||||||
| - run: exit 0 # TODO: add upgrade test uses the image built in the build-docker-image step | |||||||||||||||||
|
|
|||||||||||||||||
| build_all-apps: | |||||||||||||||||
| name: Build All Rollkit Binaries | |||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||
|
|
|||||||||||||||||
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow