fix: ci: idk #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Send Release Message | |
on: | |
push: | |
branches: | |
- development | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
SMR_API_KEY: | |
required: true | |
RELEASE_WEBHOOK_URL: | |
required: true | |
permissions: | |
actions: read | |
jobs: | |
send-release-message: | |
name: Deploy to SMR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Find Release | |
uses: actions/github-script@v7 | |
id: find-release | |
with: | |
script: | | |
const response = await github.rest.repos.listReleases({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
per_page: 1, | |
}); | |
const release = response.data[0]; | |
/*if (release.draft) { | |
core.setFailed('Found Release is a draft!'); | |
return; | |
}*/ | |
console.log(body); | |
return {body: release.body, body_encoded: btoa(release.body), tag_name: release.tag_name, name: release.name}; | |
- name: Prepare Discord Message | |
uses: actions/github-script@v7 | |
id: prepare-msg | |
env: | |
body: ${{steps.find-release.outputs.result.body}} | |
version: ${{steps.find-release.outputs.result.tag_name}} | |
with: | |
script: | | |
let body = process.env.body; | |
let version = process.env.version; | |
let split = body.split(/\n(.*)/s); | |
split.splice(1, 0, `_(${version})_`); | |
split.push("\n\n<@&1018202499678736446>"); | |
return split.join(""); | |
- name: Send Discord Webhook | |
uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.RELEASE_WEBHOOK_URL }} | |
content: ${{steps.prepare-msg.outputs.result}} |