Merged
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
disable: make check for deb package build, may not work on github runner
Comment on lines
+13
to
+110
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| DEB_BUILD_OPTIONS: nocheck # or whatever options you need | ||
| strategy: | ||
| matrix: | ||
| distro: [debian-bookworm, debian-bullseye, ubuntu-24.04, ubuntu-22.04] | ||
| include: | ||
| - distro: debian-bookworm | ||
| image: debian:bookworm | ||
| os: debian | ||
| version: bookworm | ||
| - distro: debian-bullseye | ||
| image: debian:bullseye | ||
| os: debian | ||
| version: bullseye | ||
| - distro: ubuntu-24.04 | ||
| image: ubuntu:24.04 | ||
| os: ubuntu | ||
| version: noble | ||
| - distro: ubuntu-22.04 | ||
| image: ubuntu:22.04 | ||
| os: ubuntu | ||
| version: jammy | ||
| container: | ||
| image: ${{ matrix.image }} | ||
| steps: | ||
| - name: Install build dependencies | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl jq | ||
|
|
||
| - name: Checkout source | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Mark working directory as safe | ||
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | ||
|
|
||
| - name: Fetch all branches | ||
| run: git fetch --tags | ||
|
|
||
| - name: update branch name | ||
| run: | | ||
| safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-') | ||
| sed "s|BRANCH_VERSION|$safe_branch|" configure.ac.in > configure.ac | ||
| env: | ||
| GITHUB_REF_NAME: ${{ github.ref_name }} | ||
|
|
||
| - name: Prepare autotools | ||
| run: | | ||
| # Nur falls nicht schon vorhanden (optional) | ||
| autoreconf -fi | ||
|
|
||
| - name: Build .deb package | ||
| run: | | ||
| # baue mit dpkg-buildpackage (ohne signieren) | ||
| dpkg-buildpackage -us -uc -d | ||
|
|
||
| - name: Collect .deb artifact | ||
| run: | | ||
| mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }} | ||
| mv ../libosal_*.deb artifacts/${{ matrix.os }}/${{ matrix.version }} | ||
|
|
||
| - name: Set sanitized image name | ||
| id: sanitize | ||
| run: | | ||
| version=$(dpkg-parsechangelog | sed -n 's/^Version: //p') | ||
| echo "sanitized_image=$(echo "$version-$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT | ||
| env: | ||
| IMAGE: ${{ matrix.image }} | ||
|
|
||
| - name: Upload .deb package | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb | ||
| path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb | ||
|
|
||
| - name: Ensure package is present | ||
| run: | | ||
| echo "Files in workspace:" | ||
| find * | ||
|
|
||
| - name: Set up Python and install cloudsmith-cli | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install cloudsmith-cli | ||
|
|
||
|
|
||
| - name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }}) | ||
| env: | ||
| CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
| run: | | ||
| FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb" | ||
| cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \ | ||
| --republish \ | ||
| --api-key "$CLOUDSMITH_API_KEY" |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 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. Based on the operations performed in the workflow, the following permissions are appropriate:
contents: readfor accessing repository contents.packages: writefor uploading packages to Cloudsmith.
The permissions block can be added at the root level of the workflow to apply to all jobs, or within the build-deb job to limit permissions to that specific job.
Suggested changeset
1
.github/workflows/build-deb.yaml
| @@ -2,2 +2,6 @@ | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| on: |
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.