ci: add dependabot config and PR redirect workflow
- dependabot.yml: target pre-release branch for npm and cargo updates - redirect-pr-to-prerelease.yml: auto-redirect PRs to main → pre-release with a friendly comment explaining the workflow
This commit is contained in:
2 files changed
+43
No files matched your search
@@ -0,0 +1,13 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
target-branch: "pre-release"
|
||||
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/src-tauri"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
target-branch: "pre-release"
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Redirect PRs to pre-release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
redirect:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.pull_request;
|
||||
|
||||
// Change base branch from main to pre-release
|
||||
await github.rest.pulls.update({
|
||||
...context.repo,
|
||||
pull_number: pr.number,
|
||||
base: 'pre-release'
|
||||
});
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
...context.repo,
|
||||
issue_number: pr.number,
|
||||
body: `Base branch changed from \`main\` to \`pre-release\` automatically.\n\nIn this project, \`main\` is reserved for tagged releases. All PRs should target \`pre-release\` for integration testing first. Thanks!`
|
||||
});
|
||||
Reference in new issue
Block a user