-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
114 lines (93 loc) · 3.45 KB
/
action.yml
File metadata and controls
114 lines (93 loc) · 3.45 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
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
103
104
105
106
107
108
109
110
111
112
113
114
name: Sync SWA roles with GitHub repo permissions
description: >
swa-github-role-sync syncs Azure Static Web Apps and GitHub roles by posting invitation links to Discussions.
author: Atsushi Nakamura
# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: users
color: purple
inputs:
github-token:
description: 'GitHub token with permissions to read collaborators and create
discussions.'
required: true
target-repo:
description:
'Target repository in owner/repo format. Defaults to the current
repository.'
required: false
swa-name:
description: 'Name of the target Azure Static Web App.'
required: true
swa-resource-group:
description: 'Resource group name of the Static Web App.'
required: true
swa-domain:
description:
'Domain of the Static Web App (e.g. your-app.azurestaticapps.net). Used
for invite links.'
required: false
invitation-expiration-hours:
description: 'Invitation link expiration in hours (1-168).'
required: false
default: '168'
minimum-permission:
description: 'Minimum GitHub permission level to sync. Options: read, triage, write, maintain, admin.'
required: false
default: write
role-for-admin:
description: 'SWA role name assigned to GitHub admin users.'
required: false
default: github-admin
role-for-maintain:
description: 'SWA role name assigned to GitHub maintain users.'
required: false
default: github-maintain
role-for-write:
description: 'SWA role name assigned to GitHub write users.'
required: false
default: github-write
role-for-triage:
description: 'SWA role name assigned to GitHub triage users.'
required: false
default: github-triage
role-for-read:
description: 'SWA role name assigned to GitHub read users.'
required: false
default: github-read
role-prefix:
description: 'Prefix used to detect SWA roles managed by this action.'
required: false
default: github-
discussion-category-name:
description: 'Discussion category name where invite summary Discussion will be created.'
required: true
discussion-title-template:
description: 'Template for discussion title. Placeholders: {swaName}, {repo}, {date}, {login}.'
required: false
default: SWA access invite for @{login} ({swaName}) - {date}
discussion-body-template:
description: |
Template for discussion body. Placeholders: {swaName}, {repo}, {summaryMarkdown}, {login}, {role}, {inviteUrl}, {invitationExpirationHours}.
required: false
default: |
Hi @{login},
You now have **{role}** access to **{swaName}** from **{repo}**.
- Invite link: {inviteUrl}
- Role: {role}
- Expires in: {invitationExpirationHours} hours
Use the invite link above to authenticate. After you confirm access, close this discussion so the admins know you're done. If the invite expired, comment here and we'll re-run the sync.
runs:
using: node20
main: dist/sync.js
outputs:
added-count:
description: Number of users newly invited on SWA.
updated-count:
description: Number of users whose SWA roles were updated.
removed-count:
description: Number of users removed from SWA roles.
discussion-url:
description: URL of the first created Discussion (kept for backward compatibility).
discussion-urls:
description: Newline-separated URLs of every invite Discussion (empty when no invites).