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

milestone/changelog checkers #112

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check PR change log

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changelog_checker:
name: Check if change log entry is correct
runs-on: ubuntu-latest
steps:
- name: Check change log entry
uses: scientific-python/[email protected]
env:
CHANGELOG_FILENAME: CHANGES.rst
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/check_milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check PR milestone

on:
# So it cannot be skipped.
pull_request_target:
types: [opened, synchronize, milestoned, demilestoned]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
# https://stackoverflow.com/questions/69434370/how-can-i-get-the-latest-pr-data-specifically-milestones-when-running-yaml-jobs
milestone_checker:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
if: github.repository == 'spacetelescope/lcviz'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data } = await github.request("GET /repos/{owner}/{repo}/pulls/{pr}", {
owner: context.repo.owner,
repo: context.repo.repo,
pr: context.payload.pull_request.number
});
if (data.milestone) {
core.info(`This pull request has a milestone set: ${data.milestone.title}`);
} else {
core.setFailed(`A maintainer needs to set the milestone for this pull request.`);
}
Loading