-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace unpinned actions with pinned action
- Loading branch information
1 parent
ecc15fd
commit 2d77fec
Showing
1 changed file
with
7 additions
and
9 deletions.
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 |
---|---|---|
@@ -1,33 +1,31 @@ | ||
name: Pull Request Validation | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, edited, reopened ] | ||
|
||
types: [opened, edited, reopened] | ||
jobs: | ||
check-pr-content: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'stacklokbot[bot]' }} | ||
steps: | ||
- name: Check PR for Change Type Selection | ||
uses: actions/github-script@v7 | ||
uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 # v7 | ||
with: | ||
script: | | ||
const pr = context.payload.pull_request; | ||
if (!pr) { | ||
console.log('This action must be run on a pull request event.'); | ||
core.setFailed('No pull request data found.'); | ||
return; | ||
} | ||
const prNumber = pr.number; | ||
const body = pr.body; | ||
console.log(`Processing PR #${prNumber}`); | ||
const changeTypeRegex = /\- \[[xX]\] (Bug fix|Feature|Breaking change|Documentation)/; | ||
if (!changeTypeRegex.test(body)) { | ||
core.setFailed("You must select at least one Change Type."); | ||
} |