Skip to content

Commit

Permalink
Merge release strategy changes into 'main' (#1336)
Browse files Browse the repository at this point in the history
* Tweaks to release pipeline (#1332)

* Set environment based on different push events (#1330)

* Fix: Forgot to define the branch variable (#1331)

* Set error message on failure

* Fix tag name syntax

* Check source branches have hotfix or feature prefixes (#1334)

* Open dependencies against main and staging (#1335)
  • Loading branch information
DrizzlyOwl authored Aug 8, 2024
1 parent 08e1ac6 commit ca65d8e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/branch-protection-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate source branch

on:
pull_request:
branches:
- main
- staging

jobs:
check:
name: Incoming branch validation
runs-on: ubuntu-latest
steps:
- id: branch
name: Check branch name
run: |
GIT_BRANCH=${{ github.head_ref }}
if [[ "$GIT_BRANCH" =~ ^hotfix/*|^feature/*|^renovate/* ]];
then
echo "'$GIT_BRANCH' is a permitted branch"
exit 0
else
echo "'$GIT_BRANCH' is not a permitted branch"
exit 1
fi
3 changes: 2 additions & 1 deletion .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
else
# Only main and staging branches can auto-deploy via push trigger
# Exit with failure
echo "Only 'main' and 'staging' branches can be deployed via a push trigger"
exit 1
fi
fi
Expand All @@ -70,7 +71,7 @@ jobs:
- id: release
name: Set release name
run: |
RELEASE=${${{ steps.environment.outputs.environment }},,}-`date +%Y-%m-%d`.${{ github.run_number }}
RELEASE=${{ steps.environment.outputs.environment }}-`date +%Y-%m-%d`.${{ github.run_number }}
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
deploy-image:
Expand Down
1 change: 1 addition & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"timezone": "Europe/London",
"minimumReleaseAge": "7 days",
"baseBranches": ["main", "staging"],
"automergeSchedule": ["after 10am every weekday", "before 4pm every weekday"],
"labels": ["dependencies", "renovate"],
"vulnerabilityAlerts": {
Expand Down

0 comments on commit ca65d8e

Please sign in to comment.