Add GitHub Action for formatting CMS markdown content #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Apps PR Review Notification | |
on: | |
pull_request: | |
types: [opened, ready_for_review] | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare Reviewers List and App Info | |
id: format_info | |
run: | | |
REVIEWERS=$(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login' | paste -sd ", " -) | |
APP_PATH=$(echo "${{ github.event.pull_request.changed_files }}" | grep -o 'apps/[^/]*' | head -1) | |
if [ -z "$REVIEWERS" ]; then | |
REVIEWERS="No reviewers assigned" | |
fi | |
echo "REVIEWERS=$REVIEWERS" >> $GITHUB_ENV | |
echo "APP_PATH=$APP_PATH" >> $GITHUB_ENV | |
- name: Post text to a Slack channel | |
uses: slackapi/[email protected] | |
with: | |
method: chat.postMessage | |
token: ${{ secrets.SLACK_BOT_TOKEN }} | |
payload: | | |
channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
text: "${{ github.actor }} has marked a pull request as ready for review in ${{ env.APP_PATH }}: <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>\nReviewers: ${{ env.REVIEWERS }}" |