Skip to content

Add SVGO warning comment to pull requests #6

Add SVGO warning comment to pull requests

Add SVGO warning comment to pull requests #6

name: Add SVGO Warning to PRs
on:
pull_request:
types: [opened, edited, reopened]
jobs:
add-warning:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Add Warning Comment
uses: actions/github-script@v7
with:
script: |
const { context, github } = require('@actions/github');
const issue_number = context.payload.pull_request.number;
const repo = context.repo.repo;
const owner = context.repo.owner;
const comment = {
owner,
repo,
issue_number,
body: '⚠️ Please ensure all SVG files are optimized using SVGO, by running `npm run svgo`, before merging this pull request.'
};
await github.issues.createComment(comment);