mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-08 07:37:48 +02:00
fix: deliver ECC announcements to Discord (#2732)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
name: Discussion Announce
|
||||
|
||||
on:
|
||||
discussion:
|
||||
types: [created]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: discord-discussion-${{ github.event.discussion.node_id }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
if: github.event.discussion.category.name == 'Announcements'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout trusted default branch
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
ref: ${{ github.event.repository.default_branch }}
|
||||
persist-credentials: false
|
||||
- name: Send announcement to Discord
|
||||
run: node scripts/discord/release-announce.mjs
|
||||
env:
|
||||
ANNOUNCEMENT_KIND: discussion
|
||||
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
|
||||
DISCORD_ANNOUNCE_CHANNEL_ID: ${{ secrets.DISCORD_ANNOUNCE_CHANNEL_ID }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
DISCUSSION_ID: ${{ github.event.discussion.node_id }}
|
||||
DISCUSSION_TITLE: ${{ github.event.discussion.title }}
|
||||
DISCUSSION_BODY: ${{ github.event.discussion.body }}
|
||||
DISCUSSION_URL: ${{ github.event.discussion.html_url }}
|
||||
DISCUSSION_CATEGORY: ${{ github.event.discussion.category.name }}
|
||||
@@ -1,29 +1,36 @@
|
||||
name: Release Announce
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_run:
|
||||
workflows: [Release]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
discussions: write
|
||||
|
||||
concurrency:
|
||||
group: discord-release-${{ github.event.workflow_run.id }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
discussions: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout trusted default branch
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
ref: ${{ github.event.repository.default_branch }}
|
||||
persist-credentials: false
|
||||
- name: Announce release to Discord + Discussions
|
||||
- name: Create announcement and send it to Discord
|
||||
run: node scripts/discord/release-announce.mjs
|
||||
env:
|
||||
ANNOUNCEMENT_KIND: release
|
||||
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
|
||||
DISCORD_ANNOUNCE_CHANNEL_ID: ${{ secrets.DISCORD_ANNOUNCE_CHANNEL_ID }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
RELEASE_NAME: ${{ github.event.release.name }}
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||
RELEASE_URL: ${{ github.event.release.html_url }}
|
||||
RELEASE_BODY: ${{ github.event.release.body }}
|
||||
RELEASE_TAG: ${{ github.event.workflow_run.head_branch }}
|
||||
|
||||
Reference in New Issue
Block a user