-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6340843
commit 61d8a2f
Showing
2 changed files
with
47 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |