1
0

block-outdated-3rdparty.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: Block merging with outdated 3rdparty/
  2. on:
  3. pull_request:
  4. types: [opened, ready_for_review, reopened, synchronize]
  5. permissions:
  6. contents: read
  7. concurrency:
  8. group: block-outdated-3rdparty-${{ github.head_ref || github.run_id }}
  9. cancel-in-progress: true
  10. jobs:
  11. block-outdated-3rdparty:
  12. name: Block merging with outdated 3rdparty/
  13. runs-on: ubuntu-latest-low
  14. steps:
  15. - name: Check requirement
  16. uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  17. id: changes
  18. continue-on-error: true
  19. with:
  20. filters: |
  21. src:
  22. - '3rdparty'
  23. - 'version.php'
  24. - name: Checkout
  25. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  26. - name: 3rdparty commit hash on current branch
  27. id: actual
  28. run: |
  29. echo "commit=$(git submodule status | grep ' 3rdparty' | egrep -o '[a-f0-9]{40}')" >> "$GITHUB_OUTPUT"
  30. - name: Last 3rdparty commit on target branch
  31. id: target
  32. run: |
  33. echo "commit=$(git ls-remote https://github.com/nextcloud/3rdparty refs/heads/${{ github.base_ref }} | awk '{ print $1}')" >> "$GITHUB_OUTPUT"
  34. - name: Compare if 3rdparty commits are different
  35. run: |
  36. echo '3rdparty/ seems to not point to the last commit of the dedicated branch:'
  37. echo "Branch has: ${{ steps.actual.outputs.commit }}"
  38. echo "${{ github.base_ref }} has: ${{ steps.target.outputs.commit }}"
  39. - name: Fail if 3rdparty commits are different
  40. if: ${{ steps.changes.outputs.src != 'false' && steps.actual.outputs.commit != steps.target.outputs.commit }}
  41. run: |
  42. exit 1