Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
75d3633
Bump webpack from 5.90.3 to 5.94.0 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 5, 2024
67f6053
Bump micromatch from 4.0.5 to 4.0.8 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 9, 2024
56e3913
Bump braces from 3.0.2 to 3.0.3 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 9, 2024
3a8ce1c
Bump Microsoft.Data.SqlClient in /DigitalLearningSolutions.Data.Tests
dependabot[bot] Sep 9, 2024
c333cf0
Bump dompurify from 2.4.7 to 2.5.4 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 16, 2024
2d83b17
Create auto-merge.yml
binon Nov 29, 2024
79a7cc2
Merge pull request #2983 from TechnologyEnhancedLearning/master
binon Nov 29, 2024
dc5201c
Bump eslint-plugin-import in /DigitalLearningSolutions.Web (#2985)
dependabot[bot] Nov 29, 2024
7ca7306
Bump NUnit3TestAdapter from 4.5.0 to 4.6.0 (#2988)
dependabot[bot] Nov 29, 2024
23e3623
Bump core-js from 3.36.0 to 3.39.0 in /DigitalLearningSolutions.Web (…
dependabot[bot] Nov 29, 2024
2e76e69
Bump eslint-plugin-jasmine in /DigitalLearningSolutions.Web (#2986)
dependabot[bot] Nov 29, 2024
fbdb983
Bump rimraf from 5.0.5 to 5.0.10 in /DigitalLearningSolutions.Web (#2…
dependabot[bot] Nov 29, 2024
4bb395b
Bump babel-loader from 9.1.3 to 9.2.1 in /DigitalLearningSolutions.We…
dependabot[bot] Nov 29, 2024
f645616
Bump xunit from 2.6.2 to 2.9.2 (#2993)
dependabot[bot] Nov 29, 2024
59628e7
Bump Dapper from 2.1.24 to 2.1.35 (#2995)
dependabot[bot] Nov 29, 2024
d816ad8
Bump Selenium.Support and Selenium.WebDriver
dependabot[bot] Nov 29, 2024
96230a9
Bump Microsoft.Data.SqlClient from 5.1.5 to 5.2.2 (#2992)
dependabot[bot] Nov 29, 2024
a8e74f6
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
f32d515
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
32bcbb4
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
cec3d75
Merge pull request #2991 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
5f304d6
Merge pull request #2829 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
1311590
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
85585fc
Bump HtmlAgilityPack from 1.11.54 to 1.11.71
dependabot[bot] Nov 29, 2024
135c740
Bump Selenium.Axe and Selenium.WebDriver
dependabot[bot] Nov 29, 2024
f9b3a60
Upgraded the SqlClient manulaly to 5.2.2
binon Nov 29, 2024
db6eecb
Merge pull request #2826 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
45ee60a
Merge pull request #2819 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
81e9d14
Merge pull request #2997 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
6405248
Bump Microsoft.AspNetCore.Mvc.Testing from 6.0.25 to 7.0.0
dependabot[bot] Nov 29, 2024
767807a
Merge pull request #2840 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
3aa6c7c
Merge branch 'Automatic_version_update_dependabot' into dependabot/nu…
binon Nov 29, 2024
faf17c7
Merge pull request #2996 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
7e30e2c
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
2a8ec3b
Bump nhsuk-frontend from 6.1.0 to 6.2.0 in /DigitalLearningSolutions.…
dependabot[bot] Nov 29, 2024
be597de
Bump eslint-plugin-jasmine in /DigitalLearningSolutions.Web (#3000)
dependabot[bot] Nov 29, 2024
9d58071
Bump input-range-scss in /DigitalLearningSolutions.Web (#3006)
dependabot[bot] Nov 29, 2024
10eb243
Merge pull request #2828 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
ada5b3a
Bump @typescript-eslint/eslint-plugin in /DigitalLearningSolutions.We…
dependabot[bot] Nov 29, 2024
7111af2
Bump regenerator-runtime in /DigitalLearningSolutions.Web (#3002)
dependabot[bot] Nov 29, 2024
9ac23c0
Upgraded FluentMigrator and its dependencies manually
binon Nov 29, 2024
7a1b148
Merge pull request #2998 from TechnologyEnhancedLearning/dependabot/n…
kevwhitt-hee Dec 3, 2024
8fcc378
Merge pull request #3011 from TechnologyEnhancedLearning/Automatic_ve…
kevwhitt-hee Dec 3, 2024
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
178 changes: 178 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Auto Merge Dependabot PRs

on:
pull_request:
types:
- opened
- synchronize

permissions:
pull-requests: write
contents: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

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

# Authenticate GitHub CLI using the provided token
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token

- name: Wait for CI workflow to pass (Ensure CI workflow succeeded)
id: wait_for_ci
run: |
# Get the PR number from the GitHub event
PR_NUMBER=${{ github.event.pull_request.number }}
echo "Checking CI status for PR #$PR_NUMBER"

# Define the maximum wait time (in seconds) and the polling interval (in seconds)
MAX_WAIT_TIME=600 # 10 minutes
POLL_INTERVAL=10 # Check every 10 seconds

# Initialize a timer
elapsed_time=0

# Poll CI status until all checks are completed
while true; do
# Fetch the status check rollup for the PR
CI_STATUS=$(gh pr view $PR_NUMBER --json statusCheckRollup)

# Log the fetched response
echo "CI Status Response: $CI_STATUS"

# Parse the checks and check their status
ALL_COMPLETED=true
ALL_CHECKS_PASSED=true

for check in $(echo "$CI_STATUS" | jq -r '.statusCheckRollup[] | @base64'); do
_jq() {
echo "${check}" | base64 --decode | jq -r "${1}"
}

status=$(_jq '.status')
conclusion=$(_jq '.conclusion')
check_name=$(_jq '.name')

# Log check details
echo "Check: $check_name, Status: $status, Conclusion: $conclusion"
if [[ "$check_name" == "auto-merge" ]]; then
echo "Skipping 'auto-merge' workflow check to prevent self-referencing."
continue
fi

# If any check is still in progress, set ALL_COMPLETED to false
if [[ "$status" == "IN_PROGRESS" ]]; then
ALL_COMPLETED=false
fi

# If any completed check has failed, set ALL_CHECKS_PASSED to false
if [[ "$status" == "COMPLETED" && "$conclusion" != "SUCCESS" ]]; then
ALL_CHECKS_PASSED=false
fi
done

# Break the loop if all checks are completed
if [[ "$ALL_COMPLETED" == true ]]; then
break
fi

# Wait for the next polling interval
echo "Waiting for checks to complete... ($elapsed_time/$MAX_WAIT_TIME seconds elapsed)"
sleep $POLL_INTERVAL
elapsed_time=$((elapsed_time + POLL_INTERVAL))

# Exit if the maximum wait time is exceeded
if [[ "$elapsed_time" -ge "$MAX_WAIT_TIME" ]]; then
echo "Timed out waiting for CI checks to complete."
exit 1
fi
done

# Final check: Ensure all CI checks passed
if [[ "$ALL_CHECKS_PASSED" == false ]]; then
echo "One or more CI checks failed. Aborting merge."
exit 1
fi

echo "All CI checks passed successfully."


- name: Check Target Branch and PR Title
id: check_branch
run: |
PR_TITLE='${{ github.event.pull_request.title }}'
echo "Original PR Title: $PR_TITLE"

# Escape problematic quotes
ESCAPED_TITLE=$(echo "$PR_TITLE" | sed 's/"/\\"/g')
echo "Escaped PR Title: $ESCAPED_TITLE"

if [[ "$ESCAPED_TITLE" =~ ([0-9]+\.[0-9]+\.[0-9]+).*to.*([0-9]+\.[0-9]+\.[0-9]+) ]]; then
# Extract version numbers
OLD_VERSION="${BASH_REMATCH[1]}"
NEW_VERSION="${BASH_REMATCH[2]}"
echo "Version change detected: $OLD_VERSION to $NEW_VERSION"

# Split version into major, minor, patch components
OLD_MAJOR=$(echo "$OLD_VERSION" | cut -d '.' -f1)
OLD_MINOR=$(echo "$OLD_VERSION" | cut -d '.' -f2)
OLD_PATCH=$(echo "$OLD_VERSION" | cut -d '.' -f3)

NEW_MAJOR=$(echo "$NEW_VERSION" | cut -d '.' -f1)
NEW_MINOR=$(echo "$NEW_VERSION" | cut -d '.' -f2)
NEW_PATCH=$(echo "$NEW_VERSION" | cut -d '.' -f3)

# Check if it's a minor or patch update
if [[ "$OLD_MAJOR" == "$NEW_MAJOR" ]] && [[ "$OLD_MINOR" == "$NEW_MINOR" ]] && [[ "$NEW_PATCH" -gt "$OLD_PATCH" ]]; then
echo "Patch update detected"
echo "should_merge=true" >> $GITHUB_ENV
elif [[ "$OLD_MAJOR" == "$NEW_MAJOR" ]] && [[ "$NEW_MINOR" -gt "$OLD_MINOR" ]]; then
echo "Minor update detected"
echo "should_merge=true" >> $GITHUB_ENV
else
echo "No minor/patch update detected"
echo "should_merge=false" >> $GITHUB_ENV
fi
else
echo "No version change detected"
echo "should_merge=false" >> $GITHUB_ENV
fi

- name: Debug Context
uses: actions/github-script@v6
with:
script: |
console.log("Target branch:", context.payload.pull_request.base.ref);

- name: Check if Should Merge
run: |
echo "DEBUG: should_merge=${{ env.should_merge }}"
if [[ "${{ env.should_merge }}" == "true" ]] && [[ "${{ github.event.pull_request.base.ref }}" == "Automatic_version_update_dependabot" ]]; then
echo "DEBUG: should merge PR"
echo "should_merge=true" >> $GITHUB_ENV
else
echo "DEBUG: skip merge"
echo "should_merge=false" >> $GITHUB_ENV
fi

- name: Merge Pull Request
if: ${{ env.should_merge == 'true' }}
uses: actions/github-script@v6
with:
script: |
github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
merge_method: "squash"
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="FluentMigrator" Version="3.3.2" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.3.2" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="FluentMigrator" Version="6.2.0" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="6.2.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="FluentMigrator" Version="5.0.0" />
<PackageReference Include="FluentMigrator.Runner" Version="5.0.0" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.3" />
<PackageReference Include="NBuilder" Version="6.1.0" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.25" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Selenium.Axe" Version="4.0.14" />
<PackageReference Include="Selenium.Support" Version="4.16.2" />
<PackageReference Include="Selenium.WebDriver" Version="4.16.2" />
<PackageReference Include="Selenium.Axe" Version="4.0.21" />
<PackageReference Include="Selenium.Support" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="122.0.6261.11100" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.4.0" />
<PackageReference Include="FluentAssertions.AspNetCore.Mvc" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.25" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="FluentAssertions.AspNetCore.Mvc" Version="3.2.0" />
<PackageReference Include="NBuilder" Version="6.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@

<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="FluentMigrator" Version="3.3.2" />
<PackageReference Include="FluentMigrator.Runner" Version="3.3.2" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="3.3.2" />
<PackageReference Include="FluentMigrator" Version="6.2.0" />
<PackageReference Include="FluentMigrator.Runner" Version="6.2.0" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="6.2.0" />
<PackageReference Include="FuzzySharp" Version="2.0.2" />
<PackageReference Include="GDS.MultiPageFormData" Version="1.0.6" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.54" />
<PackageReference Include="HtmlSanitizer" Version="8.0.795" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.29" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.24" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.FeatureManagement" Version="3.1.0" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.5.1" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.4.2">
Expand Down
Loading
Loading