Skip to content

Test action

Test action #20

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