Skip to content

Commit a8fc8c6

Browse files
authored
Merge pull request #214 from TechnologyEnhancedLearning/master
update
2 parents 8af05c4 + a852b58 commit a8fc8c6

File tree

4 files changed

+46
-60
lines changed

4 files changed

+46
-60
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This script seperate major and minor but we do merge them into the same branch.
2+
# Having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
3+
name: Auto-merge Dependabot PRs
4+
on:
5+
pull_request:
6+
types: [opened, synchronize]
7+
branches: [Automatic_version_update_dependabot] # Make sure this matches your actual branch name
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
auto-merge:
15+
runs-on: ubuntu-latest
16+
if: github.actor == 'dependabot[bot]'
17+
steps:
18+
- name: Extract update type
19+
id: extract
20+
run: |
21+
PR_TITLE="${{ github.event.pull_request.title }}"
22+
if [[ $PR_TITLE == *"(major)"* ]]; then
23+
echo "update_type=major" >> $GITHUB_OUTPUT
24+
else
25+
echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
26+
fi
27+
28+
- name: Auto-merge minor and patch updates
29+
if: steps.extract.outputs.update_type == 'minor_or_patch'
30+
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Auto-merge major updates
35+
if: steps.extract.outputs.update_type == 'major'
36+
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/automerge-passing-minor-patch-dependabot-prs.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/dev.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
branches-ignore:
55
- 'main'
66
- 'master'
7+
# We currently dont intend to test the showcase per package bump so wont run for package bumps
8+
# we will run on the collected bumps merging though
9+
- 'dependabot/**'
10+
711
workflow_dispatch:
812

913
permissions:
@@ -83,7 +87,7 @@ jobs:
8387
echo "Semantic Release packages installed."
8488
npm ls --depth=0 # Debug: List installed packages
8589
86-
#configured with .releaseserc
90+
# Configured with .releaseserc
8791
# Dry run we are not versioning the repo
8892
- name: Run dev semantic version (None Blocking)
8993
id: detect_semantic_version

.github/workflows/workflow-readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ The individual steps also automatically pass so can see if any error at the end
8181
# Notes
8282
- doesnt run easily with nektos act due to git ref checks and calling other workflows
8383
- for tests use the run-tests-and-report-with-env-values.ps1 file
84+
- dependabot duplicates tokens using dependabot secrets including write so can run checks
85+
- autoverging is being tried for major and minor
86+
- branch checks must pass for merge on automated_version
8487

8588
## Versioning
8689
Via semantic release and recorded as a generate c# file used by a blazor component

0 commit comments

Comments
 (0)