generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 2.71 KB
/
test.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
workflow_dispatch:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
outputs:
NBGV_SemVer2: ${{ steps.gitversion.outputs.NBGV_SemVer2 }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for GitVersioning
- name: Set Node.js 20.x
uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
- run: |
npm ci
npx nbgv cloud --all-vars
- name: gitversion
id: gitversion
run: |
echo "NBGV_SemVer2=$NBGV_SemVer2"
echo "NBGV_SemVer2=$NBGV_SemVer2" >> $GITHUB_OUTPUT
- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- run: |
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: ./
name: Get key1
id: get-app-configuration
with:
resourceGroup: ${{ vars.RESOURCE_GROUP }}
appConfigurationName: ${{ vars.APP_CONFIGURATION }}
keyFilter: 'key1'
# This step only runs if value is not what was expected
- run: |
echo ${{ steps.get-app-configuration.outputs.key1 }}
exit 1
if: ${{ steps.get-app-configuration.outputs.key1 != 'key1 value' }}
name: Check result
- uses: ./
name: Get Key Vault value
id: get-app-configuration2
with:
resourceGroup: ${{ vars.RESOURCE_GROUP }}
appConfigurationName: ${{ vars.APP_CONFIGURATION }}
- name: Dump steps context
run: echo '${{ toJSON(steps) }}"''
continue-on-error: true
# This step only runs if value is not what was expected
- run: |
echo ' ${{ toJSON(steps.get-app-configuration2.outputs['ref kv secret 1']) }} '
name: Check result
continue-on-error: true
- run: printenv
name: Dump environment
update_release_draft:
name: Update release draft
runs-on: ubuntu-latest
needs: [build]
env:
NBGV_SemVer2: ${{ needs.build.outputs.NBGV_SemVer2 }}
if: github.ref == 'refs/heads/main' # Running this job only for master branch
steps:
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@v5
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ needs.build.outputs.NBGV_SemVer2 }}