Skip to content

Add workflow script for repository management #1

Add workflow script for repository management

Add workflow script for repository management #1

Workflow file for this run

name: 'Test PR comment'
on:
pull_request:
types: [opened]
jobs:
create_comment:
runs-on: 'ubuntu-latest'
permissions:
pull-requests: write
contents: read
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
GH_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v4
with:
filter: 'blob:none'
fetch-depth: 0
ref: main
- name: Changed gems and non gem files
id: changes
run: |
# TODO: checkout the main branch
ruby .github/workflows/pr_bot/changed_files.rb
- name: Prepare comment body
id: comment-body
env:
CHANGED_GEMS: ${{ steps.changes.outputs.gems }}
CHANGED_NON_GEMS: ${{ steps.changes.outputs.non_gems }}
run: |
ruby .github/workflows/pr_bot/welcome_comment_body.rb "$CHANGED_GEMS" "$CHANGED_NON_GEMS"
- name: test message
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
COMMENT_BODY: ${{ steps.comment-body.outputs.welcome_comment_body }}
run:
gh pr comment "$PR_NUMBER" --body "$COMMENT_BODY" --repo "$GH_REPO"