1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 02:45:06 +00:00

chore: add a job to check the PR milestone is set (#9966)

* chore: add a job to check the PR milestone is set

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* Update .github/workflows/check-milestone.yaml

Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>

* Update .github/workflows/check-milestone.yaml

Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>

* Update .github/workflows/check-milestone.yaml

Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>

* fix: remove the release branch from the milestone check

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: Mariam Fahmy <mariamfahmy66@gmail.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
This commit is contained in:
Mariam Fahmy 2024-03-30 10:42:15 +01:00 committed by GitHub
parent 912364293c
commit b67141154f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

33
.github/workflows/check-milestone.yaml vendored Normal file
View file

@ -0,0 +1,33 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: check-milestone
permissions: {}
on:
pull_request:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-milestone:
runs-on: ubuntu-latest
steps:
- name: Check milestone
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
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 milestone need to be set on this pull request.`);
}