Skip to content

Commit ae2cc81

Browse files
authored
Merge branch 'dev' into master
2 parents 5930fed + 40ccdd8 commit ae2cc81

File tree

108 files changed

+217
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+217
-4
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Generates a release build artifact (nuget) from HEAD of master for auth module.
5+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
6+
7+
pool:
8+
vmImage: "windows-latest"
9+
10+
variables:
11+
BRANCH: 'weeklyOpenApiDocsDownload'
12+
GitUserEmail: '[email protected]'
13+
GitUserName: 'Microsoft Graph DevX Tooling'
14+
BaseBranch: 'dev'
15+
16+
schedules:
17+
- cron: "0 0 * * WED" # Run Every Wednesday
18+
displayName: "Weekly OpenApiDocs Download and PR"
19+
branches:
20+
include:
21+
- dev
22+
always: true
23+
24+
steps:
25+
- checkout: self
26+
persistCredentials: true
27+
clean: true
28+
fetchDepth: 1
29+
30+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
31+
displayName: 'Run CredScan'
32+
inputs:
33+
debugMode: false
34+
35+
- task: PowerShell@2
36+
displayName: "Compute Branch"
37+
inputs:
38+
targetType: inline
39+
script: |
40+
$branch = "{0}.{1}" -f "weeklyOpenApiDocsDownload", (Get-Date -Format yyyyMMdd)
41+
Write-Host "##vso[task.setvariable variable=BRANCH;]$branch"
42+
43+
- task: PowerShell@2
44+
displayName: "Configure User"
45+
inputs:
46+
targetType: 'inline'
47+
script: |
48+
git config --global user.email '$(GitUserEmail)'
49+
git config --global user.name '$(GitUserName)'
50+
51+
- task: PowerShell@2
52+
displayName: "Show Directory"
53+
inputs:
54+
targetType: 'inline'
55+
script: |
56+
ls $(System.DefaultWorkingDirectory)
57+
ls $(System.DefaultWorkingDirectory)/tools
58+
59+
- task: PowerShell@2
60+
displayName: Download v1.0 OpenApiDocs
61+
inputs:
62+
filePath: '$(System.DefaultWorkingDirectory)/tools/UpdateOpenApi.ps1'
63+
pwsh: true
64+
65+
- task: PowerShell@2
66+
displayName: Download beta OpenApiDocs
67+
inputs:
68+
filePath: '$(System.DefaultWorkingDirectory)/tools/UpdateOpenApi.ps1'
69+
arguments: '-BetaGraphVersion'
70+
pwsh: true
71+
72+
- task: Bash@3
73+
displayName : "Create PR $(BRANCH)"
74+
inputs:
75+
targetType: 'inline'
76+
script: |
77+
git status
78+
git checkout $(BaseBranch)
79+
git branch $(BRANCH)
80+
git checkout $(BRANCH)
81+
git status
82+
83+
- task: Bash@3
84+
displayName : "Commit Downloaded Files"
85+
env:
86+
GITHUB_TOKEN: $(GITHUB_TOKEN)
87+
inputs:
88+
targetType: 'inline'
89+
script: |
90+
git status
91+
git add .
92+
git commit -m 'Weekly OpenApiDocs Download'
93+
git status
94+
git push --set-upstream origin $(BRANCH)
95+
git status
96+
97+
# References
98+
# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
99+
# [1] https://hub.github.com/hub-pull-request.1.html
100+
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

.github/workflows/main.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
if: github.event_name == 'push' && !contains(toJson(github.event.commits), 'NO_CI') && !contains(toJson(github.event.commits), '[ci skip]') && !contains(toJson(github.event.commits), '[skip ci]')
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
- name: Configure User
23+
run: |
24+
git config --global user.email "[email protected]"
25+
git config --global user.name "Microsoft Graph DevX Tooling"
26+
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
31+
- name: List Directory
32+
run: |
33+
echo $GITHUB_WORKSPACE
34+
ls -lsa $GITHUB_WORKSPACE
35+
ls -lsa $GITHUB_WORKSPACE/tools
36+
37+
# Create a pull request [1]
38+
- name: Create PR using the GitHub REST API via hub
39+
shell: bash
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
MESSAGE_TITLE: Weekly OpenApiDocs Download
43+
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action,\n\n Contains OpenApiDocs Updates from Graph Explorer API"
44+
REVIEWERS: peombwa,ddyett,darrelmiller
45+
ASSIGNEDTO: finsharp
46+
LABELS: generated
47+
BASE: dev
48+
HEAD: ${{steps.create_branch.outputs.branch}}
49+
run: |
50+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
51+
bin/hub pull-request -b "$BASE" -h "$HEAD" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -a "$ASSIGNEDTO" -l "$LABELS"
52+
# References
53+
# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
54+
# [1] https://hub.github.com/hub-pull-request.1.html
55+
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)