From 169574b465bd42563875e784cce77c410d5db7ba Mon Sep 17 00:00:00 2001
From: Recolic <git@me.recolic.net>
Date: Mon, 18 Dec 2023 19:26:35 -0800
Subject: [PATCH] .

---
 README.md |  2 ++
 apply.sh  |  7 +++++--
 smpolicy  | 11 +++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100755 smpolicy

diff --git a/README.md b/README.md
index c726648..40c51bb 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # azure-build-policy-apply
 
+## WARNING: MOVED to git.recolic.net/root/scripts
+
 ## dependencies
 
 - azure-cli (+ devops extension)
diff --git a/apply.sh b/apply.sh
index 09b57b8..74fe1ce 100755
--- a/apply.sh
+++ b/apply.sh
@@ -159,6 +159,7 @@ setup_build_policy() {
     ]
   }
 }'
+############ json from original author, should also works.
 #            '
 #    {
 #        "isEnabled": true,
@@ -206,5 +207,7 @@ setup_branch_security
 setup_build_policy
 setup_build_validation
 
-echo "Sadly. you still need to access this page to set policy:"
-echo "https://msazure.visualstudio.com/One/_settings/repositories?_a=policiesMid&repo=$repo_id&refs=refs/heads/$branch"
+echo "If it's not working, make sure your PAT has FULL permission to EVERYTHING!!!"
+echo "Build at"
+echo "    https://msazure.visualstudio.com/One/_build?definitionId=285519&_a=summary"
+microsoft-edge-stable --disable-features=msUndersideButton "https://msazure.visualstudio.com/One/_build?definitionId=285519&_a=summary"
diff --git a/smpolicy b/smpolicy
new file mode 100755
index 0000000..a9b10c9
--- /dev/null
+++ b/smpolicy
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+[[ $1 = '' ]] && echo "Usage: smpolicy <SMA_branch_name>" && exit 1
+
+./apply.sh --org-url https://msazure.visualstudio.com --proj-name One --repo-name Networking-Datapath-HostSdnStack-SMAgent --branch "$1" --pipeline-name Overlake-Build-PullRequest
+
+echo "If it's not working, make sure your PAT has FULL permission to EVERYTHING!!!"
+echo "Build at"
+echo "    https://msazure.visualstudio.com/One/_build?definitionId=285519&_a=summary"
+microsoft-edge-stable --disable-features=msUndersideButton "https://msazure.visualstudio.com/One/_build?definitionId=285519&_a=summary"
+
-- 
GitLab