Skip to content

Commit d88d1a0

Browse files
authored
chore(ci): update workflow triggers for releases (#207)
* chore(ci): update workflow triggers for releases Signed-off-by: Ruben Romero Montes <[email protected]> * chore(ci): the ea id is taken from the package.json. no need to distinguish Signed-off-by: Ruben Romero Montes <[email protected]> --------- Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent 1e378c9 commit d88d1a0

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
pull_request:
66
branches:
77
- main
8+
- 'release/*'
89

910
concurrency:
1011
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/release.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@ env:
99

1010
on:
1111
workflow_dispatch:
12-
pull_request_target:
13-
types:
14-
- closed
15-
branches:
16-
- 'main'
17-
paths:
18-
- "src/**"
19-
- "package-lock.json"
20-
- "package.json"
21-
- "tsconfig.json"
22-
- ".github/workflows/release.yml"
12+
inputs:
13+
version_type:
14+
description: 'Type of version bump'
15+
required: true
16+
default: 'patch'
17+
type: choice
18+
options:
19+
- patch
20+
- minor
21+
- major
2322

2423
jobs:
2524
release:
2625
runs-on: ubuntu-latest
2726
environment: staging
28-
if: github.repository_owner == 'trustification' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/' )
2927
name: Release the project
3028
steps:
3129
- name: Checkout sources
@@ -65,15 +63,9 @@ jobs:
6563
echo "oldest-tag=$(git for-each-ref --sort=creatordate --format '%(refname:lstrip=2)' refs/tags | grep ${{ steps.last-release.outputs.base-tag }} | head -n 1)" >> "$GITHUB_OUTPUT"
6664
6765
- name: determine semver component to bump
68-
env:
69-
BUMP_PART: ${{ contains(github.event.pull_request.title,'major') && 'major' || 'check-minor' }}
7066
id: bump-decision
7167
run: |
72-
if [[ $BUMP_PART == 'check-minor' ]]; then
73-
echo "bump-part=${{ contains(github.event.pull_request.title,'minor') && 'minor' || 'patch' }}" >> "$GITHUB_OUTPUT"
74-
else
75-
echo "bump-part=major" >> "$GITHUB_OUTPUT"
76-
fi
68+
echo "bump-part=${{ github.event.inputs.version_type }}" >> "$GITHUB_OUTPUT"
7769
7870
- name: Update package with new version
7971
id: bump

.github/workflows/stage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
branches:
1616
- main
17+
- 'release/*'
1718

1819
paths:
1920
- "src/**"

0 commit comments

Comments
 (0)