-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [#1] Check for nonempty PR description
- Loading branch information
Showing
4 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |