Skip to content

Commit

Permalink
logic for dependabot merging
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jun 20, 2020
1 parent 788e3fe commit 6465348
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .build/.build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="JetBrains.ReSharper.CommandLineTools" ExcludeAssets="All" />
<PackageReference Include="GitVersion.Tool" ExcludeAssets="All" />
<PackageReference Include="ReportGenerator" ExcludeAssets="All" />
<PackageReference Include="Rocket.Surgery.Nuke.DotNetCore" />
<PackageReference Include="Rocket.Surgery.Nuke" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi
var buildJob = configuration.Jobs.First(z => z.Name == "Build");
var checkoutStep = buildJob.Steps.OfType<CheckoutStep>().Single();
// For fetch all
// checkoutStep.FetchDepth = 0;
checkoutStep.FetchDepth = 0;
buildJob.Steps.InsertRange(buildJob.Steps.IndexOf(checkoutStep) + 1, new BaseGitHubActionsStep[] {
new RunStep("Fetch all history for all tags and branches") {
Run = "git fetch --prune --unshallow"
Run = "git fetch --prune"
},
new SetupDotNetStep("Use .NET Core 2.1 SDK") {
DotNetVersion = "2.1.x"
Expand Down
5 changes: 5 additions & 0 deletions .github/label-commenter-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
labels:
- name: ':shipit: merge'
labeled:
pr:
body: '@dependabot squash and merge'
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ jobs:
uses: actions/checkout@v2
with:
clean: 'false'
fetch-depth: '0'
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
git fetch --prune
- name: 🔨 Use .NET Core 2.1 SDK
uses: actions/setup-dotnet@v1
with:
Expand All @@ -63,7 +64,11 @@ jobs:
Write-Host Copying from $from to $to;
Copy-Item "$from\*" $to -Recurse -Force;
}
<<<<<<< Updated upstream

=======

>>>>>>> Stashed changes
- name: 🎁 dotnet tool restore
run: |
dotnet tool restore
Expand All @@ -80,7 +85,7 @@ jobs:
run: |
dotnet nuke Pack --skip
- name: 🐿 Publish Coverage
uses: codecov/codecov-action@v1.0.7
uses: codecov/codecov-action@v1
with:
name: 'actions-${{ matrix.os }}'
fail_ci_if_error: 'true'
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/dependabot-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Dependabot Commenter

on:
pull_request:
types:
- labeled

jobs:
comment:
runs-on: ubuntu-18.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- uses: actions/checkout@v2
with:
ref: master
- name: Dependabot Commenter
if: |
(github.event.label.name == ':shipit: merge') && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]')
uses: peaceiris/actions-label-commenter@v1
with:
github_token: ${{ secrets.RSG_BOT_TOKEN }}
config_file: .github/label-commenter-dependabot.yml
25 changes: 0 additions & 25 deletions .github/workflows/nukeeper.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- .github/workflows/sync-labels.yml
- .github/labels.yml
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * 4'

jobs:
sync_labels:
Expand Down
9 changes: 0 additions & 9 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
pull_request_rules:
- name: automatic merge when GitHub branch protection passes (dependabot)
conditions:
- base=master
- author~=^dependabot(|-preview)\[bot\]$
- 'label=:shipit: merge'
actions:
merge:
method: squash
strict: false
- name: automatic merge when GitHub branch protection passes (others)
conditions:
- base=master
Expand Down
4 changes: 2 additions & 2 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ issue-labels-include:
- ':blue_book: documentation'
- ':beetle: bug'
- ':hammer: chore'
- ':raised_hand: good first issue'
- ':raised_hand: help wanted'
- 'good first issue'
- 'help wanted'
- ':sparkles: mysterious'
- ':package: dependencies'
- ':construction: deprecated'
Expand Down
2 changes: 1 addition & 1 deletion Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Update="JetBrains.ReSharper.CommandLineTools" Version="2020.1.3" />
<PackageReference Update="Nuke.Common" Version="0.25.0-alpha0292" />
<PackageReference Update="ReportGenerator" Version="4.6.1" />
<PackageReference Update="Rocket.Surgery.Nuke.DotNetCore" Version="0.14.0-beta.3" />
<PackageReference Update="Rocket.Surgery.Nuke" Version="0.14.0-beta.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
Expand Down

0 comments on commit 6465348

Please sign in to comment.