Skip to content

Commit 53863cc

Browse files
Merge pull request #2038 from nextcloud/backport/2037/stable30
[stable30] Create block-merge-eol.yml
2 parents de7aed1 + 0d667fb commit 53863cc

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
#
6+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Block merges for EOL
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: block-merge-eol-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
block-merges-eol:
22+
name: Block merges for EOL branches
23+
24+
# Only run on stableXX branches
25+
if: startsWith( github.base_ref, 'stable')
26+
runs-on: ubuntu-latest-low
27+
28+
steps:
29+
- name: Set server major version environment
30+
run: |
31+
# retrieve version number from branch reference
32+
server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
33+
echo "server_major=$server_major" >> $GITHUB_ENV
34+
echo "current_month=$(date +%Y-%m)" >> $GITHUB_ENV
35+
36+
- name: Checking if ${{ env.server_major }} is EOL
37+
run: |
38+
curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \
39+
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99" | . >= "${{ env.current_month }}"' \
40+
| grep -q true

0 commit comments

Comments
 (0)