-
Notifications
You must be signed in to change notification settings - Fork 5.9k
60 lines (57 loc) · 2.14 KB
/
dependabot-bot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# The name used in the GitHub UI for the workflow
name: "update dependabot.yml"
# When to run this action:
# - Scheduled to run at 5 AM every Monday.
# - Manually runnable from the GitHub UI with a reason
on:
schedule:
- cron: "0 5 * * 1" # 5 AM every Monday.
workflow_dispatch:
inputs:
reason:
description: "The reason for running the workflow"
required: true
default: "Manual run"
# Run on the latest version of Ubuntu
permissions:
contents: read
jobs:
dependabot-bot:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
# Checkout the repo into the workspace within the VM
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Setup .NET
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
# with:
# dotnet-version: 7.0.x
# dotnet-quality: 'preview'
# If triggered manually, print the reason why
- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"
# Run the .NET dependabot-bot tool
- name: dependabot-bot
id: dependabot-bot
uses: dotnet/docs-tools/actions/dependabot-bot@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
root-directory: "/github/workspace"
dependabot-yml-path: ".github/dependabot.yml"
- name: Create pull request
if: github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet'
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
branch: create-dependabotconfig-pull-request/patch
title: "Update dependabot.yml - automatically."
body: ".NET dependabot-bot automated PR. 🤖"
commit-message: ".NET dependabot-bot automated PR."