Skip to content

Commit 726529b

Browse files
Antreesybackportbot[bot]
authored andcommitted
chore(ci): add new workflows
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 6d3bd7f commit 726529b

File tree

4 files changed

+185
-0
lines changed

4 files changed

+185
-0
lines changed
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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: 2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Block unconventional commits
10+
11+
on:
12+
pull_request:
13+
types: [opened, ready_for_review, reopened, synchronize]
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: block-unconventional-commits-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
block-unconventional-commits:
24+
name: Block unconventional commits
25+
26+
runs-on: ubuntu-latest-low
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
32+
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
33+
with:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/fixup.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Block fixup and squash commits
10+
11+
on:
12+
pull_request:
13+
types: [opened, ready_for_review, reopened, synchronize]
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: fixup-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
commit-message-check:
24+
if: github.event.pull_request.draft == false
25+
26+
permissions:
27+
pull-requests: write
28+
name: Block fixup and squash commits
29+
30+
runs-on: ubuntu-latest-low
31+
32+
steps:
33+
- name: Run check
34+
uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2
35+
with:
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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: 2023-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Npm audit fix and compile
10+
11+
on:
12+
workflow_dispatch:
13+
schedule:
14+
# At 2:30 on Sundays
15+
- cron: '30 2 * * 0'
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
branches: ['main', 'master', 'stable30', 'stable29', 'stable28']
25+
26+
name: npm-audit-fix-${{ matrix.branches }}
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
ref: ${{ matrix.branches }}
33+
34+
- name: Read package.json node and npm engines version
35+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
36+
id: versions
37+
with:
38+
fallbackNode: '^20'
39+
fallbackNpm: '^10'
40+
41+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
42+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
43+
with:
44+
node-version: ${{ steps.versions.outputs.nodeVersion }}
45+
46+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
47+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
48+
49+
- name: Fix npm audit
50+
id: npm-audit
51+
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
52+
53+
- name: Run npm ci and npm run build
54+
if: always()
55+
env:
56+
CYPRESS_INSTALL_BINARY: 0
57+
run: |
58+
npm ci
59+
npm run build --if-present
60+
61+
- name: Create Pull Request
62+
if: always()
63+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
64+
with:
65+
token: ${{ secrets.COMMAND_BOT_PAT }}
66+
commit-message: 'fix(deps): Fix npm audit'
67+
committer: GitHub <[email protected]>
68+
author: nextcloud-command <[email protected]>
69+
signoff: true
70+
branch: automated/noid/${{ matrix.branches }}-fix-npm-audit
71+
title: '[${{ matrix.branches }}] Fix npm audit'
72+
body: ${{ steps.npm-audit.outputs.markdown }}
73+
labels: |
74+
dependencies
75+
3. to review

0 commit comments

Comments
 (0)