Skip to content

Commit

Permalink
fix(GitHub): split notify reviewrs job into atomic tasks and work on …
Browse files Browse the repository at this point in the history
…reviewrs list formatting
  • Loading branch information
hamikhambardzumyan committed Feb 20, 2024
1 parent 33cccec commit 27ebb38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/notify-reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get Reviewers
id: reviewers
id: get_reviewers
run: |
echo "::set-output name=reviewers::$(echo '${{ github.event.pull_request.requested_reviewers.*.login }}' | tr ' ' '\n')"
echo "reviewers=$(echo '${{ github.event.pull_request.requested_reviewers.*.login }}' | tr ' ' '\n')" >> "$GITHUB_OUTPUT"
- name: Accumulate Reviewers
id: accumulate_reviewers
run: |
REVIEWERS=${{ steps.reviewers.outputs.reviewers }}
REVIEWERS=${{ steps.get_reviewers.outputs.reviewers }}
REVIEWERS_LIST=""
# Iterate over the reviewers and accumulate bullet list
Expand All @@ -23,16 +22,15 @@ jobs:
done
# Set the accumulated reviewers list as an output
echo "::set-output name=reviewers_list::$REVIEWERS_LIST"
echo "reviewers_list=$REVIEWERS_LIST" >> "$GITHUB_OUTPUT"
- name: Send Notification
env:
INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT: ${{ secrets.INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT }}
run: |
PR_ID=${{ github.event.pull_request.number }}
PR_URL=${{ github.event.pull_request.html_url }}
PR_AUTHOR=${{ github.event.pull_request.user.login }}
REVIEWERS=${{ github.event.pull_request.requested_reviewers.*.login }}
REVIEWERS=${{ steps.accumulate_reviewers.outputs.reviewers_list }}
MESSAGE="@channel\nNew Pull Request: [#$PR_ID]($PR_URL) by @$PR_AUTHOR\nRequested Reviewers: $REVIEWERS"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Install dependencies
run: npm install
run: npm ci
- name: 🔧 Build
run: npm run build
- name: 📦 Publish package on NPM
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Install dependencies
run: npm install
- name: 🔧 Pure build
run: npm ci
- name: 🔧 Pure build
run: npm run build -- --pure
- name: 🧪 Run tests
run: npm run test
Expand Down

0 comments on commit 27ebb38

Please sign in to comment.