From 0736f95ce8776366dc9ca569f49ba505feb6373c Mon Sep 17 00:00:00 2001 From: Dmitriy Mozgovoy Date: Fri, 5 Jan 2024 21:36:41 +0200 Subject: [PATCH] fix(ci): refactor notify action as a job of publish action; (#6176) --- .github/workflows/notify.yml | 12 ++++++------ .github/workflows/publish.yml | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 4df1459..384602c 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -12,12 +12,12 @@ on: # branches: # - main # - 'v**' - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - branches: - - main - - 'v**' + #push: + # tags: + # - 'v[0-9]+.[0-9]+.[0-9]+' + # branches: + # - main + # - 'v**' workflow_dispatch: inputs: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 080b8f2..ada28b2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -56,3 +56,25 @@ jobs: run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} + notify: + needs: [publish] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: git config + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - run: npm ci + ############# Add release comments and tags to published PRs ############## + - name: Notify published PRs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node ./bin/actions/notify_published.js --tag ${{ github.event.inputs.tag || github.event.release.tag_name }}