diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 885a05d..49b460c 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -13,7 +13,7 @@ jobs: contents: write steps: - - name: Checkout + - name: Checkout main uses: actions/checkout@v4 with: fetch-depth: 0 @@ -24,17 +24,20 @@ jobs: with: config: cliff.toml args: --verbose + output_file: CHANGELOG.md env: - OUTPUT: CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - - name: Commit + - name: Checkout or create changelog branch + run: | + git fetch origin changelog || echo "changelog branch yok, oluşturulacak" + git checkout -B changelog + + - name: Commit changelog run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' - git add CHANGELOG.md git diff --cached --quiet && exit 0 - - git commit -m "Update changelog" - git push origin changelog + git commit -m "Update changelog from main" + git push origin changelog --force diff --git a/scripts/utils/github.js b/scripts/utils/github.js index 18ecad1..4dc4355 100644 --- a/scripts/utils/github.js +++ b/scripts/utils/github.js @@ -55,7 +55,7 @@ async function createRelease(version, tgzPath, body = "") { tag_name: version, name: version, body: body || `Release ${version}`, - draft: false, + draft: true, prerelease, }; @@ -78,11 +78,12 @@ async function createRelease(version, tgzPath, body = "") { `gh api "${release.upload_url.replace(/\{.*$/, "")}?name=install.tgz" \ -X POST \ -H "Content-Type: application/gzip" \ - --input "${resolved}"`, - { stdio: "inherit" } + --input "${resolved}"` ); } + exec(`gh release publish ${version}`); + return release; }