diff --git a/.github/workflows/notify-issues.yml b/.github/workflows/notify-issues.yml new file mode 100644 index 000000000..c4d896573 --- /dev/null +++ b/.github/workflows/notify-issues.yml @@ -0,0 +1,23 @@ +name: Notify Slack - Issues + +on: + issues: + types: [opened, reopened] + +permissions: {} + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send issue notification to Slack + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} + webhook-type: incoming-webhook + payload: | + { + "action": "${{ github.event.action }}", + "issue_url": "${{ github.event.issue.html_url }}", + "package_name": "${{ github.repository }}" + } diff --git a/.github/workflows/notify-pr.yml b/.github/workflows/notify-pr.yml new file mode 100644 index 000000000..0335e6a66 --- /dev/null +++ b/.github/workflows/notify-pr.yml @@ -0,0 +1,24 @@ +name: Notify Slack - Pull Requests + +on: + pull_request_target: + types: [opened, reopened, ready_for_review] + +permissions: {} + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send pull request notification to Slack + if: github.event.pull_request.draft == false + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }} + webhook-type: incoming-webhook + payload: | + { + "action": "${{ github.event.action }}", + "pr_url": "${{ github.event.pull_request.html_url }}", + "package_name": "${{ github.repository }}" + } diff --git a/.github/workflows/notify-release.yml b/.github/workflows/notify-release.yml new file mode 100644 index 000000000..778db7e91 --- /dev/null +++ b/.github/workflows/notify-release.yml @@ -0,0 +1,29 @@ +name: Notify Slack - Release + +on: + workflow_call: + inputs: + tag_name: + required: true + type: string + release_url: + required: true + type: string + +permissions: {} + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send release notification to Slack + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL_RELEASE }} + webhook-type: incoming-webhook + payload: | + { + "tag_name": "${{ inputs.tag_name }}", + "release_url": "${{ inputs.release_url }}", + "package_name": "${{ github.repository }}" + } diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml deleted file mode 100644 index be4bdee59..000000000 --- a/.github/workflows/notify_slack.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Slack Notifications - -on: - issues: - types: [opened, reopened] - pull_request_target: - types: [opened, reopened, ready_for_review] - -permissions: {} - -jobs: - notify: - runs-on: ubuntu-latest - steps: - - name: Send issue notification to Slack - if: github.event_name == 'issues' - uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 - with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} - webhook-type: incoming-webhook - payload: | - { - "action": "${{ github.event.action }}", - "issue_url": "${{ github.event.issue.html_url }}", - "package_name": "${{ github.repository }}" - } - - - name: Send pull request notification to Slack - if: github.event_name == 'pull_request_target' && github.event.pull_request.draft == false - uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 - with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }} - webhook-type: incoming-webhook - payload: | - { - "action": "${{ github.event.action }}", - "pr_url": "${{ github.event.pull_request.html_url }}", - "package_name": "${{ github.repository }}" - } \ No newline at end of file diff --git a/.github/workflows/release_maven.yml b/.github/workflows/release_maven.yml index 12c2f744f..52c392e47 100644 --- a/.github/workflows/release_maven.yml +++ b/.github/workflows/release_maven.yml @@ -103,3 +103,11 @@ jobs: uses: ad-m/github-push-action@4cc74773234f74829a8c21bc4d69dd4be9cfa599 # master with: github_token: ${{ secrets.GITHUB_TOKEN }} + + notify-release: + needs: [release] + uses: ./.github/workflows/notify-release.yml + with: + tag_name: v${{ github.event.inputs.release_version }} + release_url: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ github.event.inputs.release_version }} + secrets: inherit