Repository navigation
development/smartgit: Updated for version 26.1.057 #16811
Workflow file for this run
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
| --- | |
| name: PR checks | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| concurrency: | |
| group: ci-${{ github.event.number }} | |
| cancel-in-progress: true | |
| env: | |
| # renovate: datasource=docker depName=aclemons/sbo-maintainer-tools versioning=loose | |
| SBO_MAINTAINER_TOOLS_IMAGE: aclemons/sbo-maintainer-tools:0.9.8@sha256:94ca94a8be6e0daeb1ed823b097989e9d31aa3a61aa452e008188d5ed26a8d9a | |
| permissions: {} | |
| jobs: | |
| pr-checks: | |
| name: PR checks | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Calculate clone depth. | |
| id: clone-depth | |
| env: | |
| PR_COMMITS: ${{ github.event.pull_request.commits }} | |
| run: printf "fetch_depth=%s\n" "$(( PR_COMMITS + 1 ))" >> "${GITHUB_OUTPUT}" | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| show-progress: false | |
| fetch-depth: ${{ steps.clone-depth.outputs.fetch_depth }} | |
| persist-credentials: false | |
| - name: Run checks | |
| shell: bash | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| set -e | |
| set -o pipefail | |
| mkdir -p comments | |
| printf '%s\n' "$PR_NUMBER" > comments/pr-number.txt | |
| changed_projects="$(git diff-tree --name-only --diff-filter=d --no-commit-id -r "$BASE_SHA" "$HEAD_SHA" | sed '/^\./d' | sed -n '/[^\/][^\/]*\/[^\/][^\/]*\//p' | xargs -r -I xx dirname xx | awk -F/ 'NF==2' | sort -u)" | |
| if [[ -z "$changed_projects" ]] ; then | |
| printf 'No changed SlackBuild directories detected\n' | |
| exit 0 | |
| fi | |
| changed_count="$(printf '%s\n' "$changed_projects" | grep -c .)" | |
| if [[ "$changed_count" -gt 10 ]] ; then | |
| { | |
| printf '<!-- ci:too-many-changes -->\n' | |
| printf 'This PR contains too many changed packages (more than 10). Skipping normal PR checks.\n' | |
| } > comments/too-many-changes.md | |
| printf 'Too many changed packages (%s); skipping checks\n' "$changed_count" | |
| exit 0 | |
| fi | |
| docker pull "$SBO_MAINTAINER_TOOLS_IMAGE" | |
| while IFS= read -r project ; do | |
| if [[ -z "$project" ]] ; then | |
| continue | |
| fi | |
| set +e | |
| docker run --rm -v "$(pwd):/work" -w /work "$SBO_MAINTAINER_TOOLS_IMAGE" sbolint "$project" 2>&1 | tee sbolint-output | |
| sbolint_status="${PIPESTATUS[0]}" | |
| set -e | |
| slug="${project//\//:}" | |
| file_slug="${project//\//--}" | |
| { | |
| printf '<!-- ci:sbolint:%s -->\n' "$slug" | |
| if [[ "$sbolint_status" -eq 0 ]] ; then | |
| printf '#### ✅ sbolint - %s ✅\n\n' "$project" | |
| else | |
| printf '#### ⛔️ sbolint - %s ⛔️\n\n' "$project" | |
| fi | |
| printf '```\n' | |
| cat sbolint-output | |
| printf '```\n' | |
| } > "comments/sbolint-${file_slug}.md" | |
| rm -f sbolint-output | |
| done <<< "$changed_projects" | |
| while IFS= read -r project ; do | |
| if [[ -z "$project" ]] ; then | |
| continue | |
| fi | |
| short_project="$(printf '%s\n' "$project" | cut -d/ -f2)" | |
| response="$(wget -q -O - "https://slackbuilds.org/revdeps.php?q=$short_project" | sort || true)" | |
| slug="${project//\//:}" | |
| file_slug="${project//\//--}" | |
| { | |
| printf '<!-- ci:reverse-deps:%s -->\n' "$slug" | |
| printf '#### reverse dependencies - %s\n\n' "$project" | |
| if [[ -z "$response" ]] ; then | |
| printf 'None\n' | |
| else | |
| printf '%s\n' "$response" | sort | sed 's/^/- [ ] /' | |
| fi | |
| } > "comments/reverse-deps-${file_slug}.md" | |
| done <<< "$changed_projects" | |
| - name: Upload comment bodies | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: pr-comments | |
| path: comments/ | |
| if-no-files-found: ignore | |
| retention-days: 1 |