-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (65 loc) · 1.81 KB
/
action.yml
File metadata and controls
65 lines (65 loc) · 1.81 KB
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
name: 'hostwithquantum/setup-mc'
description: 'Setup the minio client (mc) on GitHub Actions'
branding:
icon: 'file'
color: 'purple'
inputs:
dl-url:
description: 'The url to download mc from'
required: true
default: 'https://dl.min.io/client/mc/release/linux-amd64/mc'
alias-name:
description: 'The name of the alias'
required: false
default: 'default'
alias-url:
description: 'The url for the s3 endpoint'
required: false
default: ''
alias-access-key:
description: 'The access key for the s3 endpoint'
required: false
alias-secret-key:
description: 'The secret key for the s3 endpoint'
required: false
default: ''
runs:
using: "composite"
steps:
- name: create bin directory
run: mkdir ${{ github.action_path }}/bin
shell: bash
- name: install the client
run: |
curl \
-H 'Cache-Control: no-cache' \
--location \
"${DL_URL}" \
-o ${{ github.action_path }}/bin/mc
echo "Installed mc from ${DL_URL}" >> $GITHUB_STEP_SUMMARY
shell: bash
env:
DL_URL: ${{ inputs.dl-url }}
- name: make executable
run: chmod +x ${{ github.action_path }}/bin/mc
shell: bash
- name: add to path
run: echo "${{ github.action_path }}/bin" >> $GITHUB_PATH
shell: bash
- run: mc --version
shell: bash
- if: ${{ inputs.alias-url != '' }}
shell: bash
run: |
set -euo pipefail
mc alias set \
"${ALIAS_NAME}" \
"${ALIAS_URL}" \
"${ALIAS_ACCESS_KEY}" \
"${ALIAS_SECRET_KEY}"
echo "Configured [${ALIAS_NAME}](${ALIAS_URL})" >> $GITHUB_STEP_SUMMARY
env:
ALIAS_NAME: ${{ inputs.alias-name}}
ALIAS_URL: ${{ inputs.alias-url }}
ALIAS_ACCESS_KEY: ${{ inputs.alias-access-key }}
ALIAS_SECRET_KEY: ${{ inputs.alias-secret-key }}