Skip to content

Commit ff24ec1

Browse files
author
George Ndungu
committed
Remove PR creation from Azure Pipelines.
Create PR in Github Workflows.
1 parent 6d1b836 commit ff24ec1

File tree

2 files changed

+54
-17
lines changed

2 files changed

+54
-17
lines changed

.azure-pipelines/download-openapidocs.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,6 @@ steps:
9494
git push --set-upstream origin $(BRANCH)
9595
git status
9696
97-
- task: Bash@3
98-
displayName: "Create Pull Request"
99-
env:
100-
GITHUB_TOKEN: $(GITHUB_TOKEN)
101-
MESSAGE_TITLE: Weekly OpenApiDocs Download
102-
MESSAGE_BODY: "This pull request was automatically created by Azure Devops, \n\n Contains Weekly OpenApiDocs Download files for v1.0 and beta"
103-
REVIEWERS: peombwa,ddyett,MIchaelMainer
104-
ASSIGNEDTO: finsharp
105-
LABELS: generated
106-
BASE: $(BaseBranch)
107-
BRANCH: $(BRANCH)
108-
inputs:
109-
targetType: 'inline'
110-
script: |
111-
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
112-
bin/hub pull-request -b "$BASE" -h "$BRANCH" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -a "$ASSIGNEDTO" -l "$LABELS"
113-
11497
# References
11598
# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
11699
# [1] https://hub.github.com/hub-pull-request.1.html

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
# This is a basic workflow to help you get started with Actions
4+
5+
name: WeeklyOpenApiDocsDownload
6+
# Controls when the action will run. Triggers the workflow on push or pull request
7+
# events but only for the master branch
8+
on:
9+
push:
10+
branches:
11+
- 'weeklyOpenApiDocsDownload*'
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
downloadOpenApiDocs:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
- name: Configure User
22+
run: |
23+
git config --global user.email "[email protected]"
24+
git config --global user.name "Microsoft Graph DevX Tooling"
25+
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: List Directory
31+
run: |
32+
echo $GITHUB_WORKSPACE
33+
ls -lsa $GITHUB_WORKSPACE
34+
ls -lsa $GITHUB_WORKSPACE/tools
35+
36+
# Create a pull request [1]
37+
- name: Create PR using the GitHub REST API via hub
38+
shell: bash
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
MESSAGE_TITLE: Weekly OpenApiDocs Download
42+
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action,\n\n Contains OpenApiDocs Updates from Graph Explorer API"
43+
REVIEWERS: peombwa,ddyett,darrelmiller
44+
ASSIGNEDTO: finsharp
45+
LABELS: generated
46+
BASE: dev
47+
HEAD: ${{steps.create_branch.outputs.branch}}
48+
run: |
49+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
50+
bin/hub pull-request -b "$BASE" -h "$HEAD" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -a "$ASSIGNEDTO" -l "$LABELS"
51+
# References
52+
# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
53+
# [1] https://hub.github.com/hub-pull-request.1.html
54+
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

0 commit comments

Comments
 (0)