From 758733fa9c7f34b3865e96ea1a3bea1f5161c3c2 Mon Sep 17 00:00:00 2001 From: Gavan Lamb Date: Fri, 14 Jun 2024 17:55:11 +1000 Subject: [PATCH] feat(GH-8): Update pull.request.opened.yml to notify slack --- .github/workflows/pull-request.opened.yml | 41 ----------------------- .github/workflows/slack.notify.yml | 33 ++++++++++++++++++ 2 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/pull-request.opened.yml create mode 100644 .github/workflows/slack.notify.yml diff --git a/.github/workflows/pull-request.opened.yml b/.github/workflows/pull-request.opened.yml deleted file mode 100644 index 0d97ffe..0000000 --- a/.github/workflows/pull-request.opened.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: 'Pull request opened' - -on: - pull_request: - types: - - opened - - reopened - -concurrency: - cancel-in-progress: false - group: pull-request-opened-${{ github.ref_name }} - -env: - environment: Preview${{ github.event.pull_request.number }} - -jobs: - update: - name: Update PR description - runs-on: ubuntu-latest - steps: - - name: Get issue details - uses: gavanlamb/github-actions/.github/actions/jira/get-issue-details@main - id: get-issue-details - with: - base-url: https://gavanlamb-team-1vid7fblvall.atlassian.net - user-email: mail@gavanlamb.com - api-token: ${{ secrets.JIRA_API_TOKEN }} - - name: Update PR - uses: gavanlamb/github-actions/.github/actions/pull-request/update-pr@main - id: update-pr - with: - issue-identifier: ${{ steps.get-issue-details.outputs.identifier }} - issue-title: ${{ steps.get-issue-details.outputs.title }} - issue-url: ${{ steps.get-issue-details.outputs.url }} - environment: ${{ env.environment }} - - name: Send message - uses: gavanlamb/github-actions/.github/actions/slack/pull-request-created@main - if: always() - with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} - title: ${{ steps.update-pr.outputs.title }} diff --git a/.github/workflows/slack.notify.yml b/.github/workflows/slack.notify.yml new file mode 100644 index 0000000..de9d19b --- /dev/null +++ b/.github/workflows/slack.notify.yml @@ -0,0 +1,33 @@ +name: Notify slack PR opened + +on: + pull_request: + types: + - opened + - reopened + +concurrency: + cancel-in-progress: false + group: pull-request-opened-${{ github.ref_name }} + +jobs: + update: + name: Update slack + runs-on: ubuntu-latest + steps: + - uses: jun3453/slack-pr-open-notification-action@v1.3.0 + name: Notify slack pr open + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }} + PULL_REQUEST_AUTHOR_NAME: ${{ github.event.pull_request.user.login }} + PULL_REQUEST_AUTHOR_ICON_URL: ${{ github.event.pull_request.user.avatar_url }} + PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }} + PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} + PULL_REQUEST_COMPARE_BRANCH_OWNER: ${{ github.event.pull_request.head.repo.owner.login }} + PULL_REQUEST_COMPARE_BRANCH_NAME: ${{ github.event.pull_request.head.ref }} + PULL_REQUEST_BASE_BRANCH_OWNER: ${{ github.event.pull_request.base.repo.owner.login }} + PULL_REQUEST_BASE_BRANCH_NAME: ${{ github.event.pull_request.base.ref }} + IS_SEND_HERE_MENTION: true + MAKE_PRETTY: true