mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +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:
parent
912364293c
commit
b67141154f
1 changed files with 33 additions and 0 deletions
33
.github/workflows/check-milestone.yaml
vendored
Normal file
33
.github/workflows/check-milestone.yaml
vendored
Normal 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.`);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue