Skip to content

chore(RSS-ECOMM-1_32): set up GitHub actions CI pipeline #29

chore(RSS-ECOMM-1_32): set up GitHub actions CI pipeline

chore(RSS-ECOMM-1_32): set up GitHub actions CI pipeline #29

Workflow file for this run

name: Continuous Integration
on:
pull_request:
branches:
- develop
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Format code with Prettier
run: npm run ci:format
automate-review:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Get PR Author
id: pr_author
run: echo "::set-output name=author::${{ github.event.pull_request.user.login }}"
- name: Assign Reviewers
if: github.actor != steps.pr_author.outputs.author # Exclude the author
run: |
author="${{ steps.pr_author.outputs.author }}"
if [[ "$author" == "stardustmeg" ]]; then
first_reviewer="Kleostro"
second_reviewer="YulikK"
elif [[ "$author" == "Kleostro" ]]; then
first_reviewer="stardustmeg"
second_reviewer="YulikK"
elif [[ "$author" == "YulikK" ]]; then
first_reviewer="stardustmeg"
second_reviewer="Kleostro"
else
echo "Author not found."
exit 1
fi
echo "First Reviewer: $first_reviewer"
echo "Second Reviewer: $second_reviewer"
# Request both reviewers
octokit/[email protected]
with:
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers
mediaType: '{"previews":["luke-cage"]}'
token: ${{ secrets.GITHUB_TOKEN }}
reviewers: $first_reviewer, $second_reviewer