Add workflow script for repository management #1
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: '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" |