forked from devkeydet/pva-alm
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.23 KB
/
workflows-pr.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
name: workflows-pr
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- .github/workflows/**
- .github/actions/**
env:
workflow_tests_script_path: .github/workflows/tests
jobs:
workflows-pr:
runs-on: ubuntu-latest
environment: marcsc-alm-demo-dev
steps:
- uses: actions/checkout@v2
# run pwsh script to run end to end test of workflows
- name: test-workflows
id: test-workflows
shell: pwsh
env:
# Workflows cannot be dispatched with the standard GITHUB_TOKEN, so we use a token that can
GITHUB_TOKEN: ${{ secrets.WORKFLOW_DISPATCH_TOKEN }}
run: |
. ${{ env.workflow_tests_script_path }}/e2e.ps1
$prHeadRef = '${{ github.event.pull_request.head.ref }}'.Replace('refs/heads/','')
$branchToCreate = 'automated-test-' + $prHeadRef
$params = @{
branchToTest = $prHeadRef
solutionName = 'pvaalm'
environmentUrl = '${{ secrets.ENVIRONMENT_URL }}'
sourceBranch = 'main'
branchToCreate = $branchToCreate
commitMessage = 'automated by workflows-pr.yml'
}
echo $params
e2e @params