Skip to content

Commit

Permalink
Replace unpinned actions with pinned action
Browse files Browse the repository at this point in the history
  • Loading branch information
stacklokbot committed Feb 22, 2024
1 parent ecc15fd commit 2d77fec
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/pr-check.yml
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.");
}

0 comments on commit 2d77fec

Please sign in to comment.