forked from microsoftgraph/msgraph-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.8 KB
/
Copy pathcreate_v1_pull_request.yml
File metadata and controls
68 lines (57 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This action will automatically create a pull request against main if the pushed branch
# has a branch path spec like v1.0/pipelinebuild/*. Configure this action by updating the
# environment variable values[0].
name: "Create pull request on generation update"
# Controls when the action will run. Triggers the workflow on push
# events but only for branches with the following branch spec: v1.0/pipelinebuild/*
on:
push:
branches:
- "v1.0/pipelinebuild/*"
paths:
- 'msgraph/generated/**'
defaults:
run:
shell: bash
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
bump-sdk-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Git config user
run: |
git config --global user.email "GraphTooling@service.microsoft.com"
git config --global user.name "Microsoft Graph DevX Tooling"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --skip-lock
- name: Increment sdk-version
run: |
pipenv run bumpver update --tag-num
- name: Push committed changes by bumpver
run: git push origin $GITHUB_REF
create-pull-request:
needs: bump-sdk-version
# The type of runner that the job will run on
runs-on: ubuntu-latest
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Create a pull request [1]
- name: Create PR using the GitHub REST API via hub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE_TITLE: Generated models and request builders using Kiota
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. See [v1.0 openapi.yml](https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/v1.0/openapi.yaml) for metadata changes. \n\n Make sure the version number is incremented in /msgraph/_version.py . Compare the version against the latest Preview version on [PyPI](https://pypi.org/project/msgraph-sdk/) and update the version accordingly."
LABELS: generated
BASE: main
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
bin/hub pull-request -b "$BASE" -h "$GITHUB_REF" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -l "$LABELS"