Url now depends on type of release

This commit is contained in:
GoldenJaden 2023-11-03 21:20:16 +03:00
parent 721fa8cf01
commit b86e9c0faf

View file

@ -4,8 +4,6 @@ on:
release:
types:
- published
env:
GITHUB_LINK: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}/"
jobs:
publish:
@ -49,17 +47,29 @@ jobs:
needs: publish
runs-on: ubuntu-latest
steps:
# Checkout to target branch
- uses: actions/checkout@v4
# Checkout to target branch
- uses: actions/checkout@v4
- name: Get package info
id: package
uses: codex-team/action-nodejs-package-info@v1
- name: Get package info
id: package
uses: codex-team/action-nodejs-package-info@v1
- name: Send a message
uses: codex-team/action-codexbot-notify@v1
with:
webhook: ${{ secrets.CODEX_BOT_NOTIFY_EDITORJS_PUBLIC_CHAT }}
message: '📦 [${{ steps.package.outputs.name }}]($GITHUB_LINK) ${{ github.ref_name }} was published'
parse_mode: 'markdown'
disable_web_page_preview: true
- name: Set link to the github repository
if: ${{ github.event_name != 'release ' }}
run: |
echo "GITHUB_LINK=${{ github.server_url }}/${{ github.repository }}" >> $GITHUB_ENV
shell: bash
# If package is released, set the link to the released version
- name: Set github link to latest version
if: ${{ github.event_name == 'release' }}
run: |
echo "GITHUB_LINK=${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}" >> $GITHUB_ENV
- name: Send a message
uses: codex-team/action-codexbot-notify@v1
with:
webhook: https://notify.bot.codex.so/u/IJBC1JPEBK5P
message: '📦 [${{ steps.package.outputs.name }} ${{ steps.package.outputs.version }}](${{ env.GITHUB_LINK }}) was published'
parse_mode: 'markdown'
disable_web_page_preview: true