This Github action will detect updates in package.json and require()
in .js files in a pull request.
In order to use this action:
- Create a folder
.github/workflows
- Create a file with .yaml extension
- Put this code in the file:
name: Unsafe PR Detector
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
detect-unsafe:
runs-on: ubuntu-latest
name: Check pull request with changes
steps:
- name: Check PR
uses: supatsara-wat/[email protected]
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
pr_number: ${{ github.event.number }}
token: ${{ secrets.GITHUB_TOKEN }}
- Don't forget to allow write permission for the GitHub workflow!!
Settings tab > Actions > General and scroll down to the “Workflow permissions” section.