Grant the WinGet catalog workflow scoped OpenArtifact OIDC access
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 15s
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 15s
This commit is contained in:
1 parent
f1a956808f
commit
b6bd9722df
3 files changed
+47
No files matched your search
@@ -31,5 +31,12 @@ try:
|
|||||||
if provider["name"] != "keycloak" or provider["result"] != "applied":
|
if provider["name"] != "keycloak" or provider["result"] != "applied":
|
||||||
raise RuntimeError("OpenArtifact did not apply the Keycloak provider")
|
raise RuntimeError("OpenArtifact did not apply the Keycloak provider")
|
||||||
print("Keycloak SSO provider applied")
|
print("Keycloak SSO provider applied")
|
||||||
|
publisher = json.loads(post("admin/declarative/apply", {
|
||||||
|
"manifest": Path("/config/winget-publisher.yaml").read_text(),
|
||||||
|
}))
|
||||||
|
items = publisher["items"]
|
||||||
|
if len(items) != 3 or any(item["result"] != "applied" for item in items):
|
||||||
|
raise RuntimeError("OpenArtifact did not apply the WinGet publisher policy")
|
||||||
|
print("WinGet publisher policy applied")
|
||||||
finally:
|
finally:
|
||||||
post("auth/logout", {})
|
post("auth/logout", {})
|
||||||
@@ -13,6 +13,7 @@ configMapGenerator:
|
|||||||
files:
|
files:
|
||||||
- sso.yaml
|
- sso.yaml
|
||||||
- apply-sso.py
|
- apply-sso.py
|
||||||
|
- winget-publisher.yaml
|
||||||
|
|
||||||
helmCharts:
|
helmCharts:
|
||||||
- name: openartifact
|
- name: openartifact
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: openartifact.io/v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: github-winget
|
||||||
|
spec:
|
||||||
|
description: Publishes the Hexor WinGet catalog from GitHub Actions
|
||||||
|
---
|
||||||
|
apiVersion: openartifact.io/v1
|
||||||
|
kind: PermissionTarget
|
||||||
|
metadata:
|
||||||
|
name: github-winget-publish
|
||||||
|
spec:
|
||||||
|
repository_filter: '^hexor-winget$'
|
||||||
|
path_pattern: '.*'
|
||||||
|
actions: [read, write]
|
||||||
|
assignments:
|
||||||
|
users: [github-winget]
|
||||||
|
---
|
||||||
|
apiVersion: openartifact.io/v1
|
||||||
|
kind: OIDCTrustPolicy
|
||||||
|
metadata:
|
||||||
|
name: github-winget-publish
|
||||||
|
spec:
|
||||||
|
issuer: https://token.actions.githubusercontent.com
|
||||||
|
audience: https://repo.hexor.cy
|
||||||
|
service_account: github-winget
|
||||||
|
token_ttl_seconds: 900
|
||||||
|
enabled: true
|
||||||
|
conditions:
|
||||||
|
- claim: repository_owner_id
|
||||||
|
patterns: ['4666566']
|
||||||
|
- claim: repository_id
|
||||||
|
patterns: ['678451959']
|
||||||
|
- claim: event_name
|
||||||
|
patterns: [repository_dispatch, workflow_dispatch]
|
||||||
|
- claim: ref
|
||||||
|
patterns: ['refs/heads/main']
|
||||||
|
- claim: workflow_ref
|
||||||
|
patterns: ['house-of-vanity/arch_repo/.github/workflows/publish-winget.yml@refs/heads/main']
|
||||||
Reference in new issue
Block a user