Skip to content
Merged

test #251

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
8af05c4
Merge pull request #203 from TechnologyEnhancedLearning/master
Phil-NHS Aug 28, 2025
a8fc8c6
Merge pull request #214 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
f468d2e
chore(cicd): cron jobs for dependabot promotion
Phil-NHS Aug 29, 2025
b9f31a4
chore(dependabot): is relesearc breaking
Phil-NHS Aug 29, 2025
ef8aaf8
chore(releaserc): config file fix
Phil-NHS Aug 29, 2025
e4a100e
chore(dependabot): add back in branch staging
Phil-NHS Aug 29, 2025
f086dd4
chore(releaserc): reapply prerelease
Phil-NHS Aug 29, 2025
8323494
chore(releaserc): prerelease is causing the issues but will need it
Phil-NHS Aug 29, 2025
ac5d8f4
chore(semver): better logging cause prerelease error try to view it
Phil-NHS Aug 29, 2025
b417400
chore(releaserc): semver
Phil-NHS Aug 29, 2025
c9ede7b
chore(semver): dependabot
Phil-NHS Aug 29, 2025
d218284
Merge pull request #218 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Aug 29, 2025
7df280b
Merge pull request #219 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
f1d0467
chore(dependabot): broader lint check
Phil-NHS Aug 29, 2025
09b04b3
Merge pull request #220 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Aug 29, 2025
5933e7d
Merge pull request #221 from TechnologyEnhancedLearning/master
Phil-NHS Aug 29, 2025
4d69e43
chore(cicd): automating pipeline progression of dependabot bumps
Phil-NHS Sep 1, 2025
bc4b547
Merge pull request #225 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
59b6a1f
chore(checks): fail due to artifact
Phil-NHS Sep 1, 2025
306ec36
chore(cicd): safer disabling of scripts
Phil-NHS Sep 1, 2025
db831a2
chore(automerge): gh docs
Phil-NHS Sep 1, 2025
a220ce0
Merge pull request #228 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
8db2b13
chore(dependabot): auto
Phil-NHS Sep 1, 2025
64ccf8c
Merge pull request #231 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
6aba224
Merge pull request #229 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
8167b1b
chore(dependabot): automated
Phil-NHS Sep 1, 2025
1bda87c
Merge pull request #233 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
b6f8099
Merge pull request #234 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
fdc368a
Merge pull request #232 from TechnologyEnhancedLearning/Automatic_ver…
Phil-NHS Sep 1, 2025
e962141
chore(dependabot): autom
Phil-NHS Sep 1, 2025
1ce7b80
Merge pull request #235 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
d744e96
chore(dependabot): naming caps
Phil-NHS Sep 1, 2025
f6c755a
Merge pull request #237 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
942f2ed
chore(dep): remove check for now
Phil-NHS Sep 1, 2025
462e148
Merge pull request #236 from TechnologyEnhancedLearning/master
Phil-NHS Sep 1, 2025
362bec9
Merge pull request #238 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
e319eb9
Merge pull request #239 from TechnologyEnhancedLearning/Automatic_ver…
Phil-NHS Sep 1, 2025
15aa4b3
chore(deps): token definition
Phil-NHS Sep 1, 2025
69acfe9
Merge pull request #241 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
acb65e5
chore(dep): merge check
Phil-NHS Sep 1, 2025
9e447b2
Merge pull request #242 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
a0b4087
chore(cicd): title catching
Phil-NHS Sep 1, 2025
b30b9f0
Merge pull request #243 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
940430d
chore(depend): title getting
Phil-NHS Sep 1, 2025
65cb2aa
Merge pull request #245 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
02114f0
chore(deps): refactor
Phil-NHS Sep 1, 2025
6639ec2
Merge pull request #246 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
098a925
chore(dependabot): automerge
Phil-NHS Sep 1, 2025
4f2e826
Merge pull request #248 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
f97d61b
chore(deps): drop debug
Phil-NHS Sep 1, 2025
2fb0e83
Merge pull request #249 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 1, 2025
7972622
chore(workflow): readme
Phil-NHS Sep 8, 2025
ccab82f
Merge pull request #253 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 15, 2025
2561a56
chore(cicd): More bredth as isnt triggering
Phil-NHS Sep 15, 2025
67c4dd5
Merge pull request #254 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 15, 2025
c432225
chore(cicd): Still not running pr failing for branch with checks
Phil-NHS Sep 15, 2025
c9d9b70
Merge pull request #256 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 15, 2025
7d4fe9b
chore(cicd): Use only development appsettings in checks
Phil-NHS Sep 16, 2025
2f05f0e
chore(cicd): need to not provide unneeded secrets even for test run
Phil-NHS Sep 16, 2025
8a00ed1
chore(cicd): Removing the prod appsetting from dev checks
Phil-NHS Sep 16, 2025
422139e
Merge pull request #282 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 16, 2025
36aae75
chore(cicd): More debugging
Phil-NHS Sep 16, 2025
8baa71e
Merge pull request #289 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 16, 2025
5789e0c
chore(cicd): if for automerge
Phil-NHS Sep 16, 2025
b32bab5
Merge pull request #291 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 16, 2025
4c59e2e
chore(cicd): quick
Phil-NHS Sep 16, 2025
617b8c6
Merge pull request #293 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 16, 2025
1fbdc38
chore(cicd): qqqqs
Phil-NHS Sep 16, 2025
885b72c
Merge pull request #296 from TechnologyEnhancedLearning/ci-dependabot…
Phil-NHS Sep 16, 2025
082d84b
feat(newversion): new version
Phil-NHS Sep 17, 2025
b3238df
feat(version): new major
Phil-NHS Sep 17, 2025
bdee7ba
feat(majorvers): big version
Phil-NHS Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,38 +1,77 @@
# This script seperate major and minor but we do merge them into the same branch.
# Having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
name: Auto-merge Dependabot PRs
# qqqq in development
# this script seperate major and minor but we do merge them into the same branch.
# having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
name: auto-merge dependabot prs into collected branch
on:
pull_request:
types: [opened, synchronize]
branches: [Automatic_version_update_dependabot] # Make sure this matches your actual branch name
# types: [opened, synchronize]
branches: [Automatic_version_update_dependabot]


permissions:
contents: write
pull-requests: write
checks: read
issues: write

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: debug info
run: |
echo "actor: ${{ github.actor }}"
echo "pr title: ${{ github.event.pull_request.title }}"
echo "github event_name: ${{ github.event_name }}"
echo "target branch: ${{ github.event.pull_request.base.ref }}"
echo "source branch: ${{ github.event.pull_request.head.ref }}"
echo "PR Number: ${{ github.event.pull_request.number }}"
echo "event type: ${{ github.event.pull_request.type || 'N/A' }}"
echo "Pull request user login: ${{ github.event.pull_request.user.login }}"
echo "Repository: ${{ github.repository }}"
echo "Event name: ${{ github.event_name }}"
echo "Event action: ${{ github.event.action }}"

# Branch rules ensure doesnt auto merge if shouldnt
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'TechnologyEnhancedLearning/TELBlazor' }}
steps:
- name: Extract update type
- name: Checkout the repository
uses: actions/checkout@v4

- name: Set up GitHub CLI
run: |
# Install GitHub CLI (gh)
sudo apt-get update
sudo apt-get install gh

- name: extract update type
id: extract
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if [[ $PR_TITLE == *"(major)"* ]]; then
echo "get pr title"
pr_title="${{ github.event.pull_request.title }}"
echo "PR title: $pr_title"
if [[ "$pr_title" == *"(major)"* ]]; then
echo "update_type=major" >> $GITHUB_OUTPUT
echo "Detected major update"
else
echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
echo "Detected minor or patch update"
fi

- name: Auto-merge minor and patch updates
- name: auto-merge minor and patch updates
if: steps.extract.outputs.update_type == 'minor_or_patch'
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
run: |
gh pr merge --auto --merge "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge major updates
- name: auto-merge major updates
if: steps.extract.outputs.update_type == 'major'
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
run: |
gh pr merge --auto --merge "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# qqqq this does add auto merge but seems to trigger on the first set of checks git guardian (it seems),
# also it calls for checks not specifically for out branch
# so an approach based one the branch is likely better
name: auto-merge dependabot prs into collected branch
on:
# pull_request:
# synchronize
# types: [opened, synchronize]
# branches: [Automatic_version_update_dependabot] # make sure this matches your actual branch name
check_suite:
types: [completed]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
checks: read

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: debug info
run: |
echo "actor: ${{ github.actor }}"
echo "pr title: ${{ github.event.pull_request.title }}"
echo "github event_name: ${{ github.event_name }}"
echo "github event_suite conlusion: ${{ github.event.check_suite.conclusion }}"
echo "target branch: ${{ github.event.pull_request.base.ref }}"
echo "source branch: ${{ github.event.pull_request.head.ref }}"
echo "Check Suite ID: ${{ github.event.check_suite.id }}"
echo "Conclusion: ${{ github.event.check_suite.conclusion }}"
echo "Target Branch: ${{ github.event.check_suite.pull_requests[0].base.ref }}"
echo "PR Number: ${{ github.event.check_suite.pull_requests[0].number }}"

- name: Dump event payload
run: |
echo "==== EVENT NAME ===="
echo "${{ github.event_name }}"
echo "==== RAW CHECK_SUITE PAYLOAD ===="
echo '${{ toJson(github.event.check_suite) }}'
echo "==== PRs in this check suite ===="
echo '${{ toJson(github.event.check_suite.pull_requests) }}'


auto-merge:
runs-on: ubuntu-latest
# if: github.event.check_suite.pull_requests[0].base.ref == 'main'
# if dependabot and checks ran
# if: (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')
# qqqq put back in later if: (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')


# qqqq add in after testing && github.actor == 'dependabot[bot]'
if: github.event.check_suite.conclusion == 'success' && github.event.check_suite.pull_requests[0].base.ref == 'Automatic_version_update_dependabot'
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Set up GitHub CLI
run: |
# Install GitHub CLI (gh)
sudo apt-get update
sudo apt-get install gh

- name: extract update type
id: extract
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "get pr number"
pr_number=${{ github.event.check_suite.pull_requests[0].number }}
echo "PR title: $pr_number"
# pr_title="${{ github.event.pull_request.title }}"
pr_title=$(gh pr view "$pr_number" --json title --jq .title)
echo "PR title: $pr_title"
if [[ $pr_title == *"(major)"* ]]; then
echo "update_type=major" >> $GITHUB_OUTPUT
else
echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
fi

- name: auto-merge minor and patch updates
if: steps.extract.outputs.update_type == 'minor_or_patch'
# auto should set the the request to merge once checks complete
# qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
# run: gh pr merge --auto 1
run: gh pr merge --auto --merge ${{ github.event.check_suite.pull_requests[0].number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: auto-merge major updates
if: steps.extract.outputs.update_type == 'major'
# auto should set the the request to merge once checks complete
# qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
# run: gh pr merge --auto 1
run: gh pr merge --auto --merge ${{ github.event.check_suite.pull_requests[0].number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# qqqq in development
name: Collected Dependabot Promotion From Staging To Master
on:
schedule:
# we want the opposite weeks to staging so we get a week where it occurs in manual testing
- cron: '0 9 8-14 * 1' # Second Monday of month
- cron: '0 9 22-28 * 1' # Fourth Monday of month
workflow_dispatch:

jobs:
promote-to-master:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changes
id: changes
run: |
git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging
git fetch origin master:master

if git diff --quiet master Automatic_collected_dependabot_staging; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Create PR to master
if: steps.changes.outputs.has_changes == 'true'
run: |
if gh pr list --head Automatic_collected_dependabot_staging --base master --json number --jq '.[0].number' | grep -q .; then
echo "PR already exists, skipping creation"
else
gh pr create \
--base master \
--head Automatic_collected_dependabot_staging \
--title "Fortnightly dependabot collected master promotion - $(date +%Y-%m-%d)" \
--body "Automated weekly promotion from staging to master after testing period" \
--auto-merge \
--merge
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/collected-dependabot-to-staging.yml-disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# qqqq in development

name: Dependabot Collected Promotion To Staging
# this logic will require branch ruleset checks of running the dev pipeline
on:
schedule:
# Promotion from staging to release should be a week apart so alternating weeks (also live updates dangerous)
- cron: '0 9 1-7 * 1' # First Monday of month
- cron: '0 9 15-21 * 1' # Third Monday of month
workflow_dispatch: # Allow manual trigger

jobs:
promote-to-automatic-collected-dependabot-staging:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changes
id: changes
run: |
git fetch origin Automatic_version_update_dependabot:Automatic_version_update_dependabot
git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging

if git diff --quiet Automatic_collected_dependabot_staging Automatic_version_update_dependabot; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Create PR to Automatic_collected_dependabot_staging
if: steps.changes.outputs.has_changes == 'true'
run: |
gh pr create \
--base Automatic_collected_dependabot_staging \
--head Automatic_version_update_dependabot \
--title "Fortnightly dependabot collected to staging - $(date +%Y-%m-%d)" \
--body "Automated Fortnightly promotion of dependency updates from dependabot" \
--auto-merge \
--merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 32 additions & 8 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
TEL_GIT_PACKAGES_TOKEN: ${{secrets.NUGETKEY }}

# Prod
UNITTESTS_APPSETTINGS_PRODUCTION: ${{ secrets.UNITTESTS_APPSETTINGS_PRODUCTION }}
WASMSTATICCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }}
WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }}
WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }}
# UNITTESTS_APPSETTINGS_PRODUCTION: ${{ secrets.UNITTESTS_APPSETTINGS_PRODUCTION }}
# WASMSTATICCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }}
# WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }}
# WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }}

# Now we've done due diligence
# The checks have been allowed to run if the workflow fails so if there a multiple fails we know.
Expand Down Expand Up @@ -92,10 +92,35 @@ jobs:
- name: Run dev semantic version (None Blocking)
id: detect_semantic_version
run: |
echo "error catch run of semver first to get any error detail on config issues"
set +e
SEMVER_OUTPUT_RAW_ERROR_CHECK=$(npx semantic-release --dry-run 2> /tmp/semantic-release-errors.log)
STATUS_ERROR_CHECK=$?

# Now you can check the status and log the error messages if an error occurred
if [ $STATUS_ERROR_CHECK -ne 0 ]; then
echo "❌ Semantic release failed with exit code $STATUS_ERROR_CHECK."
echo "❌ Error output:"
cat /tmp/semantic-release-errors.log
else
echo "✅ Semantic Ouput success : $SEMVER_OUTPUT_RAW_ERROR_CHECK "
echo "✅ Error on success : $STATUS_ERROR_CHECK"
fi

set -e


echo "running semantic-release"
SEMVER_OUTPUT_RAW=$(npx semantic-release --dry-run 2>&1)
STATUS=$?
semver_output_raw=$(npx semantic-release --dry-run 2>&1)
status=$?

# Now you can check the status and log the error messages if an error occurred
if [ $STATUS -ne 0 ]; then
echo "Semantic release failed with exit code $STATUS."
echo "Error output:"
cat /tmp/semantic-release-errors.log
fi

echo "status = $STATUS"
echo "$SEMVER_OUTPUT_RAW"

Expand Down Expand Up @@ -361,5 +386,4 @@ jobs:
-H "Authorization: Bearer $TEL_GIT_PACKAGES_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"artifact_url\": \"$artifact_url\"}}"

-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"artifact_url\": \"$artifact_url\"}}"
7 changes: 1 addition & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@ jobs:
WASMSTATICCLIENT_APPSETTINGS_DEVELOPMENT: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_DEVELOPMENT }}
WASMSERVERHOSTCLIENT_APPSETTINGS_DEVELOPMENT: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_DEVELOPMENT }}
WASMSERVERHOST_APPSETTINGS_DEVELOPMENT: ${{ secrets.WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}
TEL_GIT_PACKAGES_TOKEN: ${{secrets.NUGETKEY }}

UNITTESTS_APPSETTINGS_PRODUCTION: ${{ secrets.UNITTESTS_APPSETTINGS_PRODUCTION }}
WASMSTATICCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }}
WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }}
WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }}
TEL_GIT_PACKAGES_TOKEN: ${{secrets.NUGETKEY }}
Loading
Loading