Skip to content

Commit c37f84d

Browse files
authored
Enable Dependabot Monitoring for Repo Tools (#1732)
### Change summary This PR mirrors the same dependabot improvements we made to the `terraform-provider-fastly` repo; we are adjusting the `tools.mod` and `tools.sum` files to be monitored by dependabot. All Submissions: * [x] Have you followed the guidelines in our Contributing document? * [x] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/fastly/cli/pulls) for the same update/change? <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Are there any considerations that need to be addressed for release? We should aim to merge this next week so we don't have to deal with a flurry of PRs today (Friday) :) Prior PR refs: fastly/terraform-provider-fastly#1253 fastly/terraform-provider-fastly#1244 fastly/terraform-provider-fastly#1237
1 parent 86fd528 commit c37f84d

5 files changed

Lines changed: 38 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,24 @@ updates:
1010
go-dependencies:
1111
patterns:
1212
- "*"
13+
- package-ecosystem: "gomod"
14+
directory: "/tools"
15+
schedule:
16+
interval: "weekly"
17+
allow:
18+
- dependency-type: "all"
19+
labels:
20+
- "tools"
21+
groups:
22+
go-dependencies:
23+
patterns:
24+
- "*"
1325
- package-ecosystem: "github-actions"
1426
directory: "/"
1527
schedule:
1628
interval: "weekly"
29+
labels:
30+
- "github_actions"
1731
groups:
1832
gha-dependencies:
1933
patterns:

.github/workflows/dependabot_changelog_update.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,31 @@ on:
88
- reopened
99
permissions:
1010
contents: read
11+
pull-requests: write
1112
jobs:
1213
dependabot-changelog-update:
1314
if: github.actor == 'dependabot[bot]'
1415
runs-on: ubuntu-latest
1516
steps:
17+
- name: Check labels
18+
id: check-labels
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const labels = context.payload.pull_request.labels.map(l => l.name);
23+
const skip = labels.includes('tools') || labels.includes('github_actions');
24+
if (skip) {
25+
await github.rest.issues.addLabels({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
issue_number: context.payload.pull_request.number,
29+
labels: ['Skip-Changelog']
30+
});
31+
}
32+
return !skip;
33+
result-encoding: string
1634
- name: Generate a GitHub token
35+
if: steps.check-labels.outputs.result == 'true'
1736
id: github-token
1837
uses: actions/create-github-app-token@v3
1938
with:
@@ -22,18 +41,21 @@ jobs:
2241
owner: ${{ github.repository_owner }}
2342
repositories: "cli"
2443
- name: Checkout code
44+
if: steps.check-labels.outputs.result == 'true'
2545
uses: actions/checkout@v6
2646
with:
2747
token: ${{ steps.github-token.outputs.token }}
2848
repository: ${{ github.event.pull_request.head.repo.full_name }}
2949
ref: ${{ github.event.pull_request.head.ref }}
3050
- name: Generate changelog entry
51+
if: steps.check-labels.outputs.result == 'true'
3152
uses: dangoslen/dependabot-changelog-helper@v4
3253
with:
3354
activationLabels: dependencies
3455
changelogPath: './CHANGELOG.md'
3556
entryPrefix: 'build(deps): '
3657
- name: Commit changelog entry
58+
if: steps.check-labels.outputs.result == 'true'
3759
uses: stefanzweifel/git-auto-commit-action@v7
3860
with:
3961
commit_message: "docs(CHANGELOG.md): add dependency bump from dependabot"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
4747
# EXAMPLE:
4848
# make release GORELEASER_ARGS="--clean --skip=post-hooks --skip=validate"
4949
release: $(GO_FILES) ## Build executables using goreleaser
50-
$(GO_BIN) tool -modfile=tools.mod goreleaser build ${GORELEASER_ARGS}
50+
$(GO_BIN) tool -modfile=tools/go.mod goreleaser build ${GORELEASER_ARGS}
5151

5252
# Useful for attaching a debugger such as https://github.com/go-delve/delve
5353
debug:
@@ -121,7 +121,7 @@ scaffold-category:
121121
# e.g. make graph PKG_IMPORT_PATH=github.com/fastly/cli/pkg/commands/kvstoreentry
122122
.PHONY: graph
123123
graph: ## Graph generates a call graph that focuses on the specified package
124-
$(GO_BIN) tool -modfile=tools.mod go-callvis -file "callvis" -focus "$(PKG_IMPORT_PATH)" ./cmd/fastly/
124+
$(GO_BIN) tool -modfile=tools/go.mod go-callvis -file "callvis" -focus "$(PKG_IMPORT_PATH)" ./cmd/fastly/
125125
@rm callvis.gv
126126

127127
.PHONY: deps-app-update
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)