block-merge-eol.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. name: Block merges for EOL
  6. on: pull_request
  7. permissions:
  8. contents: read
  9. concurrency:
  10. group: block-merge-eol-${{ github.head_ref || github.run_id }}
  11. cancel-in-progress: true
  12. jobs:
  13. block-merges-eol:
  14. name: Block merges for EOL branches
  15. # Only run on stableXX branches
  16. if: startsWith( github.base_ref, 'stable')
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Download updater config
  20. run: curl https://raw.githubusercontent.com/nextcloud/updater_server/production/config/config.php --output config.php
  21. - name: Set server major version environment
  22. run: |
  23. # retrieve version number from branch reference
  24. server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
  25. echo "server_major=$server_major" >> $GITHUB_ENV
  26. - name: Checking if ${{ env.server_major }} is EOL
  27. run: |
  28. php -r 'echo json_encode(require_once "config.php");' | jq --arg version "${{ env.server_major }}" '.stable[$version]["100"].eol // .beta[$version]["100"].eol' | grep --silent -i 'false'