Skip to content

Enforce draft status on new content and new revisions #4

Enforce draft status on new content and new revisions

Enforce draft status on new content and new revisions #4

name: Contributed modules PR comment
on:
pull_request:
paths:
- 'web/config/sync/core.extension.yml'
types:
- opened
jobs:
auto-comment:
runs-on: ubuntu-latest
steps:
- name: Check PR Changes
id: pr-changes
run: echo "::set-output name=changes::${{ toJson(github.event.pull_request.changed_files) }}"
- name: Create Comment
if: steps.pr-changes.outputs.changes != '[]'
run: |
# Use GitHub API to create a comment on the PR
PR_NUMBER=${{ github.event.pull_request.number }}
COMMENT="It looks like our enabled modules has changed in this PR. Please ensure any documentation in https://github.com/weather-gov/weather.gov/tree/main/docs/contributed-modules.md has been updated!"
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"