Skip to content

Commit b31ec1b

Browse files
Måns ThörnvikCopilot
andcommitted
chore: replicate locksmith workflow updates
Replicate recent Copilot setup, MCP, and Dependabot auto-merge workflow changes from locksmith. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6896e7f commit b31ec1b

3 files changed

Lines changed: 66 additions & 2 deletions

File tree

.github/copilot/mcp.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"github": {
4+
"type": "http",
5+
"url": "https://api.githubcopilot.com/mcp/",
6+
"headers": {
7+
"Authorization": "Bearer ${GITHUB_TOKEN}"
8+
}
9+
}
10+
}
11+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
25+
with:
26+
go-version-file: go.mod
27+
cache: false
28+
29+
- name: Cache Go modules and build cache
30+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
31+
with:
32+
path: |
33+
~/go/pkg/mod
34+
~/.cache/go-build
35+
key: copilot-go-${{ hashFiles('go.sum', 'tools/go.sum') }}
36+
restore-keys: copilot-go-
37+
38+
- name: Download Go module dependencies
39+
run: |
40+
go mod download
41+
go mod download -modfile tools/go.mod
42+
43+
- name: Install golangci-lint
44+
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.0
45+
46+
- name: Warm up govulncheck
47+
run: go tool -modfile tools/go.mod govulncheck -version

.github/workflows/dependabot-auto-approve.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ jobs:
4242
gh pr merge --auto -s "$PR_URL"
4343
fi
4444
45-
- name: Re-approve after force-update if auto-merge was already configured
46-
if: steps.metadata.outcome == 'failure' && github.event.action == 'synchronize'
45+
- name: Re-approve after branch update if auto-merge was already configured
46+
# Runs on synchronize events where step 4 would be skipped — i.e. when fetch-metadata
47+
# either failed (outcome=failure) or returned an empty/unexpected update-type.
48+
# The auto-merge check inside the script guards against re-approving major updates.
49+
if: >-
50+
github.event.action == 'synchronize' &&
51+
steps.metadata.outputs.update-type != 'version-update:semver-patch' &&
52+
steps.metadata.outputs.update-type != 'version-update:semver-minor'
4753
env:
4854
PR_URL: ${{ github.event.pull_request.html_url }}
4955
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)