1
0

block-merge-eol.yml 1.1 KB

123456789101112131415161718192021222324252627282930
  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: Pull request checks
  6. on: pull_request
  7. jobs:
  8. block-merges-eol:
  9. name: Block merges for EOL branches
  10. # Only run on stableXX branches
  11. if: startsWith( github.base_ref, 'stable')
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Download updater config
  15. run: curl https://raw.githubusercontent.com/nextcloud/updater_server/production/config/config.php --output config.php
  16. - name: Set server major version environment
  17. run: |
  18. # retrieve version number from branch reference
  19. server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
  20. echo "server_major=$server_major" >> $GITHUB_ENV
  21. - name: Checking if ${{ env.server_major }} is EOL
  22. run: |
  23. php -r 'echo json_encode(require_once "config.php");' | jq --arg version "${{ env.server_major }}" '.stable[$version]["100"].eol' | grep --silent -i 'false'