Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [#1] Check for nonempty PR description #2

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: ./
env:
GH_TOKEN: ${{ github.token }}
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: ${{ github.token }}
```
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
Loading