-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (37 loc) · 1.05 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
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: |
acl="${{ inputs.acl }}"
user_regex="(?:d:)?u:([A-Za-z_]+):[rwx-]{3}"
user_regex_groups=()
if [[ $acl =~ $user_regex ]]; then
user_regex_groups+=${BASH_REMATCH[0]}
user_regex_groups+=${BASH_REMATCH[1]}
else
echo "No match"
fi
echo ${user_regex_groups[*]}
- id: group
run: |
acl="${{ inputs.acl }}"
group_regex="(?:d:)?g:([A-Za-z_]+):[rwx-]{3}"
group_regex_groups=()
if [[ $acl =~ $group_regex ]]; then
group_regex_groups+=${BASH_REMATCH[0]}
group_regex_groups+=${BASH_REMATCH[1]}
else
echo "No match"
fi
echo ${group_regex_groups[*]}