Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
revert: "ci: use log"
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard committed Jun 14, 2023
1 parent d6f9cae commit 4922867
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,34 @@ jobs:
publish:
runs-on: 'ubuntu-latest'

permissions:
contents: 'write'
pull-requests: 'read'

steps:
- uses: 'actions/checkout@v3'

- name: 'grab tag'
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: 'Publish Release'
uses: 'azurystudio/log@v1'
- name: 'publish release'
uses: 'actions/github-script@v6'
with:
script: |
const { readFile } = require('node:fs/promises')
let changelog = await readFile('./changelog.md', { encoding: 'utf-8' })
const startIndex = changelog.indexOf(`## [${process.env.TAG}]`) + `## [${process.env.TAG}](https://github.com/azurystudio/cheetah/releases/tag/${process.env.TAG})\n\n`.length
changelog = changelog.substring(startIndex)
const endIndex = changelog.indexOf('\n\n## [')
changelog = changelog.substring(0, endIndex < 0 ? undefined : endIndex)
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.TAG,
name: process.env.TAG,
body: changelog,
draft: false,
prerelease: false
})

0 comments on commit 4922867

Please sign in to comment.