Skip to content

minor(cb2-10521): change adr brake endurance weight unit of measureme… #120

minor(cb2-10521): change adr brake endurance weight unit of measureme…

minor(cb2-10521): change adr brake endurance weight unit of measureme… #120

name: Create Release
on:
push:
branches: ["develop"]
jobs:
test-and-generate-check:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup version env var
run: |
echo "VERSION=v$(jq -r .version package.json)" >> "$GITHUB_ENV"
- uses: actions/github-script@v6
with:
script: |
const prIntroducingCommit = (await github.rest.repos.listPullRequestsAssociatedWithCommit({
...context.repo,
commit_sha: context.sha
})).data[0]
prIntroducingCommit && console.log("Found pull request associated with commit... ✔️")
const githubTag = await github.rest.git.createRef({
...context.repo,
sha: context.sha,
ref: `refs/tags/${process.env.VERSION}`
})
console.log(`Created new git tag ${process.env.VERSION}... ✔️`)
const releaseBody = prIntroducingCommit.body.substring(prIntroducingCommit.body.indexOf("## Changelog"),
prIntroducingCommit.body.indexOf("<!--DO NOT REMOVE COMMENT. MARKS END OF CHANGES SECTION.-->"))
await github.rest.repos.createRelease({
...context.repo,
tag_name: process.env.VERSION,
body: releaseBody
})
console.log(`Release ${process.env.VERSION} created ✔️`)