Skip to content

Commit

Permalink
ci: sync dependabot config
Browse files Browse the repository at this point in the history
  • Loading branch information
charmcli authored and github-actions[bot] committed Feb 13, 2025
1 parent 6340843 commit 61d8a2f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 51 deletions.
57 changes: 6 additions & 51 deletions .github/workflows/dependabot-sync.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,15 @@
name: dependabot-sync
on:
workflow_call:
inputs:
repo_name:
description: The repository name, without the "charmbracelet/" prefix.
required: true
type: string
schedule:
- cron: "0 0 * * 0" # every Sunday at midnight
workflow_dispatch: # allows manual triggering
inputs:
repo_name:
description: The repository name, without the "charmbracelet/" prefix.
required: true
type: string

permissions:
contents: write
pull-requests: write
actions: write

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ github.repository_owner }}/${{ inputs.repo_name }}

- uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/meta
path: ${{ github.repository_owner }}/meta

- run: |
cp "${{ github.repository_owner }}/meta/dependabot/workflows/dependabot-sync.yml" "${{ github.repository_owner }}/${{ inputs.repo_name }}/.github/workflows/dependabot-sync.yml"
cp "${{ github.repository_owner }}/meta/dependabot/dependabot.yml" "${{ github.repository_owner }}/${{ inputs.repo_name }}/dependabot.yml"
DEPENDABOT_FILE="${{ github.repository_owner }}/meta/dependabot/dependabot-${{ inputs.repo_name }}.yml"
if [ -f "$DEPENDABOT_FILE" ]; then
cat "$DEPENDABOT_FILE" >> "${{ github.repository_owner }}/${{ inputs.repo_name }}/dependabot.yml"
fi
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: "ci: sync dependabot config"
author: Charm <[email protected]>
title: "ci: sync dependabot config"
body: |
This is an automated pull request to sync the Dependabot config with the meta repository.
branch: "ci/sync-dependabot-config"
delete-branch: true
path: "${{ github.repository_owner }}/${{ inputs.repo_name }}"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
dependabot-sync:
uses: charmbracelet/meta/.github/workflows/dependabot-sync.yml@main
with:
repo_name: ${{ github.event.repository.name }}
41 changes: 41 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "05:00"
timezone: "America/New_York"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "05:00"
timezone: "America/New_York"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "05:00"
timezone: "America/New_York"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"

0 comments on commit 61d8a2f

Please sign in to comment.