fix: update release strat
Release / Release (push) Successful in 2m18s

This commit is contained in:
2026-08-21 17:05:37 +02:00
parent cc8acb6b6a
commit 818e291ffd
5 changed files with 2 additions and 122 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ module.exports.publish = async (pluginConfig, context) => {
body: nextRelease.notes,
draft: false,
name: nextRelease.name,
prerelease: Boolean(branch.prerelease),
prerelease: false,
tag_name: nextRelease.gitTag,
target_commitish: branch.name,
}),
-73
View File
@@ -1,73 +0,0 @@
name: Open a PR to main
on:
push:
branches:
- dev
workflow_dispatch:
permissions:
pull-requests: write
contents: read
jobs:
pull-request:
name: Open pull request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Open pull request
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
SOURCE_BRANCH: ${{ gitea.ref_name }}
TARGET_BRANCH: main
shell: bash
run: |
set -euo pipefail
api_url="${GITEA_URL%/}/api/v1"
auth_header="Authorization: token ${GITEA_TOKEN}"
open_pulls="$(
curl --fail-with-body --silent --show-error \
--get \
--header "$auth_header" \
--data-urlencode "state=open" \
--data-urlencode "base_branch=${TARGET_BRANCH}" \
--data-urlencode "limit=50" \
"${api_url}/repos/${GITEA_REPOSITORY}/pulls"
)"
if jq -e --arg branch "$SOURCE_BRANCH" \
'any(.[]; .head.ref == $branch)' <<<"$open_pulls" >/dev/null; then
echo "Pull request already exists."
exit 0
fi
commits="$(git rev-list --count "origin/${TARGET_BRANCH}..HEAD")"
if [[ "$commits" -eq 0 ]]; then
echo "No commits between ${TARGET_BRANCH} and ${SOURCE_BRANCH}. Skipping pull request creation."
exit 0
fi
payload="$(
jq -n \
--arg base "$TARGET_BRANCH" \
--arg head "$SOURCE_BRANCH" \
--arg title 'chore: Merge branch `dev` to `main`' \
--arg body 'When dev (pre-release) is ready, merge this pull request to create a new stable release.' \
'{base: $base, head: $head, title: $title, body: $body}'
)"
curl --fail-with-body --silent --show-error \
--request POST \
--header "$auth_header" \
--header "Content-Type: application/json" \
--data "$payload" \
"${api_url}/repos/${GITEA_REPOSITORY}/pulls" >/dev/null
echo "Pull request created."