-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
43 lines (38 loc) · 1.19 KB
/
action.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
# License?
name: 'nuget setapikey'
description: 'Run `nuget setapikey` for a provided set of package sources'
author: 'MORYX Industry'
inputs:
sources-file:
description: 'Path to a text file, contains a list of the sources to set the API key for'
required: true
nuget-version:
required: false
default: '6.x'
api-key:
description: 'API key to set for the provided list of sources'
required: true
registry-user:
required: true
registry-pass:
required: true
runs:
using: "composite"
steps:
- uses: nuget/setup-nuget@v1
with:
nuget-version: ${{ inputs.nuget-version }}
- name: "Set API keys"
run: |
echo "::add-mask::${{ inputs.registry-user }}"
echo "::add-mask::${{ inputs.registry-pass }}"
echo "::add-mask::${{ inputs.api-key }}"
sed -i 's/\xef\xbb\xbf//' ${{ inputs.sources-file }}
while read source; do
nuget setapikey ${{ inputs.api-key }} -Source $source
nuget sources update -name $source -user ${{ inputs.registry-user }} -pass ${{ inputs.registry-pass }}
done < ${{ inputs.sources-file }}
shell: bash
branding:
icon: '🗝️'
color: 'green'