Test action #15
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: Replace Keywords with Compliments and Insults | |
on: | |
issue_comment: | |
types: [created, edited] | |
jobs: | |
replace-keywords: | |
if: github.actor != 'github-actions[bot]' # Ensure that the action isn't triggered by the bot itself | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install Node.js dependencies | |
run: | | |
npm install | |
working-directory: ./ | |
- name: Run the Node.js action to replace keywords | |
id: replace-keywords | |
uses: ./src # This points to your custom action defined in /src | |
with: | |
comment-body: "${{ github.event.comment.body }}" | |
- name: Update the Comment | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
comment-id: ${{ github.event.comment.id }} | |
body: ${{ steps.replace-keywords.outputs.updated-body }} | |
edit-mode: replace |