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

Replace unpinned actions with pinned action #2400

Merged
Merged
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
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.");
}
Loading