Skip to content

Commit

Permalink
feat: [#1] Check for nonempty PR description
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Jun 20, 2024
1 parent d092ad7 commit e38e2c8
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
18 changes: 18 additions & 0 deletions .github/workflows/mcvs-pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: MCVS-PR-validation-action
"on":
pull_request:
types:
- edited
- opened
- reopened
- synchronize
workflow_call:
jobs:
MCVS-PR-validation-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
- uses: schubergphilis/mcvs-pr-validation-action@v0.1.0
env:
GH_TOKEN: ${{ secrets.SETTINGS_GUARD }}
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# mcvs-pr-validation-action
# MCVS-PR-validation-action

Mission Critical Vulnerability Scanner (MCVS) Pull Request (PR) Validation
Action is a custom [GitHub Action](https://github.com/features/actions) that
consists of the following steps:

- Nonempty PR description.

## Usage

Create a `.github/workflows/mcvs-pr-validation.yml` file with the following
content:

```bash
---
name: MCVS-PR-validation-action
'on':
pull_request:
types:
- edited
- opened
- reopened
- synchronize
workflow_call:
jobs:
MCVS-PR-validation-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
- uses: schubergphilis/mcvs-pr-validation-action@v0.1.0
env:
GH_TOKEN: ${{ secrets.SETTINGS_GUARD }}
```
22 changes: 22 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: mcvs-pr-validation-action
description: |
Mission Critical Vulnerability Scanner (MCVS) Pull Request (PR) Validation
action.
runs:
using: composite
steps:
- name: Check whether PR description is nonempty
run: |
PR_NUMBER="${GITHUB_REF_NAME/\/merge/}"
if [[ ! ${PR_NUMBER} =~ ^[0-9]+$ ]]; then
echo "PR_NUMBER should be a number, got: ${PR_NUMBER}"
exit 1
fi
PR_DESCRIPTION=$(gh pr view ${PR_NUMBER} --json body --jq '.body')
if [[ -z "${PR_DESCRIPTION}" ]]; then
echo "Please provide a description for the pull request"
exit 1
fi
shell: bash

0 comments on commit e38e2c8

Please sign in to comment.