-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (31 loc) · 954 Bytes
/
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
name: Test Workflow
on:
workflow_dispatch:
inputs:
acl:
type: string
required: true
default: u:someone:rwx,g:some_group:rwx,d:u:someone:rwx,d:g:some_group:rwx
jobs:
groups:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: user
run: |
user_regex="(?:d:)?u:([A-Za-z_]+):[rwx-]{3}"
user_regex_groups=()
if [[ "${{ inputs.acl }}" =~ $user_regex ]]; then
user_regex_groups+=${BASH_REMATCH[0]}
user_regex_groups+=${BASH_REMATCH[1]}
fi
echo ${user_regex_groups[*]}
- id: group
run: |
group_regex="(?:d:)?g:([A-Za-z_]+):[rwx-]{3}"
group_regex_groups=()
if [[ "${{ inputs.acl }}" =~ $group_regex ]]; then
group_regex_groups+=${BASH_REMATCH[0]}
group_regex_groups+=${BASH_REMATCH[1]}
fi
echo ${group_regex_groups[*]}