Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"dependencyDashboard": true,
"schedule": ["before 3am on Friday"],
"schedule": ["* 0-2 * * 5"],
"semanticCommitType": "chore",
"gitIgnoredAuthors": ["41898282+github-actions[bot]@users.noreply.github.com"],
"rangeStrategy": "bump",
"packageRules": [
{
"matchUpdateTypes": ["major"],
"semanticCommitType": "chore",
"automerge": false,
"dependencyDashboardApproval": true
},
{
"matchManagers": ["npm"],
"matchDepTypes": ["dependencies"],
"semanticCommitType": "fix"
},
{
"matchManagers": ["npm"],
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["minor", "patch"],
"semanticCommitType": "chore",
"schedule": ["before 3am on Friday"],
"automerge": false,
"matchPackageNames": [
"*"
]
"groupName": "dev dependencies",
"groupSlug": "dev-dependencies"
}
]
}
48 changes: 48 additions & 0 deletions .github/workflows/renovate-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Renovate changeset

on:
pull_request:
branches: [main, 'v[0-9]+']
paths: [package.json]

jobs:
changeset:
if: github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Add a patch changeset for updated runtime dependencies
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_BRANCH: ${{ github.head_ref }}
PR_NUMBER: ${{ github.event.number }}
run: |
base=$(git merge-base "$BASE_SHA" HEAD)
note=".changeset/renovate-$PR_NUMBER.md"
# Respect a release note supplied by a maintainer.
if git diff --name-only --diff-filter=A "$base" HEAD -- '.changeset/*.md' ":(exclude)$note" | grep -q .; then
exit 0
fi

changes=$(jq -r --slurpfile base <(git show "${base}:package.json") '
.dependencies | to_entries[] | select(.value != $base[0].dependencies[.key]) |
"Update `\(.key)` to `\(.value)`."
' package.json)
if [ -z "$changes" ]; then
exit 0
fi

printf '%s\n' '---' "'eventsource': patch" '---' '' "$changes" > "$note"
git add -- "$note"
if git diff --cached --quiet; then
exit 0
fi
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -m 'docs: add changeset for runtime dependency update'
git push origin "HEAD:refs/heads/$HEAD_BRANCH"
Loading