Skip to content

Commit 36780a9

Browse files
authored
Merge pull request #76 from miloshb/cm
CM
2 parents 6209122 + f7a39f2 commit 36780a9

4 files changed

Lines changed: 23 additions & 12 deletions

File tree

.github/workflows/production-pipeline.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ jobs:
5555
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5656
run: npm run test:redirects
5757

58-
# JOB 2: Only run version bumping if the validation job passes AND it's the main branch
58+
# JOB 2: Only run version bumping if the validation job passes AND it's the stage branch
5959
bump-version:
6060
runs-on: ubuntu-latest
6161
needs: validate
62-
# Only bump on merges to main
63-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
62+
# Only bump version when code lands on stage
63+
if: github.event_name == 'push' && github.ref == 'refs/heads/stage'
6464
permissions:
65-
contents: write # Allows the action to push changes back to GitHub
65+
contents: write # Crucial for the bot to push commits/tags
6666

6767
steps:
6868
- name: Checkout Repository
@@ -79,13 +79,21 @@ jobs:
7979
- name: Configure Git
8080
run: |
8181
git config --global user.name "github-actions[bot]"
82-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
82+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
8383
8484
# This reads the commit message. If it contains [major] or [minor], it bumps accordingly.
85-
# Otherwise, it defaults to a standard patch bump (0.0.2 -> 0.0.3).
85+
# Otherwise, it defaults to a standard patch bump (e.g. 0.0.2 -> 0.0.3).
8686
- name: Evaluate Commits & Bump Version
8787
run: |
88+
# Grabs the latest commit message from the incoming branch
8889
COMMIT_MSG=$(git log -1 --pretty=%B)
90+
91+
# Prevent infinite loop if the last commit was already a version bump
92+
if [[ "$COMMIT_MSG" == *"chore: bump version"* ]]; then
93+
echo "Already a version bump commit. Exiting gracefully."
94+
exit 0
95+
fi
96+
8997
if [[ "$COMMIT_MSG" == *"[major]"* ]]; then
9098
npm version major -m "chore: bump version to %s [skip ci]"
9199
elif [[ "$COMMIT_MSG" == *"[minor]"* ]]; then
@@ -94,6 +102,7 @@ jobs:
94102
npm version patch -m "chore: bump version to %s [skip ci]"
95103
fi
96104
97-
- name: Push Version Update to GitHub
105+
- name: Push Version Update and Tags to Stage
98106
run: |
99-
git push origin main --follow-tags
107+
# The '-o ci.skip' option tells GitHub's server to completely ignore branch rules regarding PR requirements for this specific automated push
108+
git push origin stage --follow-tags -o ci.skip

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Studio Sun & Sea - Website
22

3-
Business-sensitive documentation has been moved to the private repository:
3+
Dynamic responsive multiligual website using Astro framework and Cloudflare edge-CDN static pages.
4+
- [Source code documentation for the website](doc)
5+
- Business-sensitive documentation has been moved to the private repository:
46
[studio-internal (private)](https://github.com/miloshb/studio-internal.git).
57

68
## Astro Starter Kit: Basics

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "studio",
33
"type": "module",
4-
"version": "0.3.9",
4+
"version": "1.3.9",
55
"engines": {
66
"node": ">=22.12.0"
77
},

0 commit comments

Comments
 (0)