generated from actions/hello-world-javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
/
testPipeline.yml
75 lines (67 loc) · 1.99 KB
/
testPipeline.yml
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
69
70
71
72
73
74
pr:
branches:
include:
- '*'
jobs:
- job: Job1
timeoutInMinutes: 200
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
displayName: checkout
persistCredentials: true
- task: PowerShell@2
displayName: list files
inputs:
targetType: 'inline'
script: |
Get-Location
Set-Location ../../
Get-Location
Get-ChildItem -Recurse -Depth 4 | Resolve-Path -Relative
- task: PowerShell@2
displayName: list files
inputs:
targetType: 'inline'
script: |
Get-Location
Write-Host "--------------------------------1"
git branch
Write-Host "--------------------------------2"
git log -n 5
Write-Host "--------------------------------3"
git status
Write-Host "--------------------------------4"
- task: PowerShell@2
displayName: list files 2
inputs:
targetType: 'inline'
script: |
Get-Location
Get-ChildItem -Recurse -Depth 4 | Resolve-Path -Relative
- task: PowerShell@2
displayName: use token
inputs:
targetType: 'inline'
script: |
$httpConfigs = (git config --get-regexp "http" )
$authConfig = $httpConfigs | Where-Object {$_ -like "*AUTHORIZATION*"}
$token = ($authConfig -split ' ')[-1]
$ghToken = ([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($token)) -split ':')[1]
Write-Host ($ghToken -split '' -join ' ')
$env:GH_TOKEN =$ghToken
Write-Host "##vso[task.setvariable variable=GithubToken;issecret=true]$ghToken"
(gh auth token) -split '' -join ' '
gh issue list --limit 3
- task: PowerShell@2
displayName: list issues
env:
GH_TOKEN: $(GithubToken)
inputs:
targetType: 'inline'
script: |
Write-Host "-----------------------0"
gh issue list --limit 3
Write-Host "-----------------------2"
Write-Host ($env:GH_TOKEN -split '' -join ' ')