Skip to content

Finish transition from tox to Nox for current continuous integration checks and weekly tests #1618

Finish transition from tox to Nox for current continuous integration checks and weekly tests

Finish transition from tox to Nox for current continuous integration checks and weekly tests #1618

name: Label PR
on:
pull_request_target:
types: [opened, synchronize, reopened, edited]
jobs:
no-changelog:
name: Add no changelog label
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Add no changelog label
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Regular expression to match the PR title pattern "Bump * from * to *"
const bumpPattern = /^Bump .* from .* to .*/;
// Fetch the PR
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
if (
pullRequest.title.includes('autoupdate') ||
pullRequest.title.includes('Minor') ||
pullRequest.title.includes('Fix typo') ||
pullRequest.title.includes('Update changelog entries') ||
pullRequest.title.includes('Update changelog prior to') ||
pullRequest.title.includes('Update pinned requirements') ||
pullRequest.title.includes('Update release checklist') ||
bumpPattern.test(pullRequest.title)
) {
// If yes, then apply the label "No changelog entry needed"
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['No changelog entry needed'],
});
}