Skip to content

Commit 9f9ac5e

Browse files
committed
Moving actions
1 parent 3104394 commit 9f9ac5e

5 files changed

Lines changed: 85 additions & 0 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# This action prevents merging pull requests that don't follow the label conventions.
3+
# The rules to allow merging a pull request are:
4+
# - it must have at least one label that describes the type of pull request
5+
# - it must not have the "do not merge" label
6+
#
7+
# HOW TO USE:
8+
#
9+
# To call this reusable action, copy the code between === lines to workflow file,
10+
# uncomment and adjust "uses" as needed (use the latest tag available).
11+
# ======================================================================
12+
# on:
13+
# pull_request:
14+
# types: [opened, reopened, labeled, unlabeled]
15+
#
16+
# (...)
17+
# steps:
18+
# (...)
19+
# - name: Validate PR labels
20+
# uses: OutSystems/rd.github-reusable-workflows/.github/actions/validate-pr-labels@v2.0.4
21+
#
22+
# ======================================================================
23+
#
24+
25+
name: Validate PR labels
26+
description: "Checks if the PR has at least one label and does not have the 'do not merge' one"
27+
28+
runs:
29+
using: composite
30+
steps:
31+
- name: Check PR has at least one type of PR label
32+
uses: mheap/github-action-required-labels@v5
33+
with:
34+
mode: minimum
35+
count: 1
36+
labels: 'feature, bug, bugfix, dependencies, dependency, chore'
37+
- name: "Check PR does not have a 'do not merge' label"
38+
uses: mheap/github-action-required-labels@v5
39+
with:
40+
mode: exactly
41+
count: 0
42+
labels: 'do not merge'
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# This action prevents merging pull requests that don't follow the title convention.
3+
# The title convention is
4+
# "+semver: <minor|major|patch> <ticket id> <description>"
5+
# OR
6+
# "<ticket id> <description>"
7+
# depending on the 'validate-semVer' input value,
8+
# where ´+semver: <minor|major|patch> ´ section is optional, and <ticket id> must be a JIRA issue identifier.
9+
#
10+
# HOW TO USE:
11+
#
12+
# To call this reusable action, copy the code between === lines to workflow file,
13+
# uncomment and adjust "uses" as needed (use the latest tag available).
14+
# ======================================================================
15+
# on:
16+
# pull_request:
17+
# types: [opened, reopened, edited]
18+
#
19+
# (...)
20+
# steps:
21+
# (...)
22+
# - name: Validate PR title
23+
# uses: OutSystems/rd.github-reusable-workflows/.github/actions/validate-pr-title@v2.0.4
24+
#
25+
# ======================================================================
26+
#
27+
28+
name: Validate PR title
29+
description: 'Checks if the PR title complies with the convention "<Jira_PROJ>: NNN <description>", e.g. RDMOR: 1234 Some description'
30+
inputs:
31+
validate-semVer:
32+
description: "PR title accepts '+semver: <minor|major|patch>' as a prefix"
33+
required: false
34+
default: 'false'
35+
36+
runs:
37+
using: composite
38+
steps:
39+
- name: "Check PR title follows '${{ inputs.validate-semVer == true && '+semver: <minor|major|patch> ' || '' }}<ticket id> <description>'"
40+
uses: deepakputhraya/action-pr-title@v1.0.2
41+
with:
42+
regex: ^${{ inputs.validate-semVer == true && '(\+semver:\s(minor|major|patch)\s)?' || '' }}([A-Z][A-Z0-9]*-\d+(:)?\s\w)
43+
if: ${{ contains(github.head_ref, 'release/') == false && contains(github.head_ref, 'merge/') == false }}

0 commit comments

Comments
 (0)