Skip to content

Commit 8458dd4

Browse files
himanshusainighimanshusainigCopilot
authored
Agent support and Logic app standard version (AzureAD#127)
* Add Standard Logic App SCIM validation tooling Adds new StandardLogicApp/ subfolder under Microsoft.SCIM.LogicAppValidationTemplate with workflow JSON definitions, parameters, deployment script (Deploy-LogicAppWorkflows.ps1), validation runner (ValidateLogicAppRun-Standard.ps1), agent onboarding doc, and converted setup guide for the Standard Logic App version of SCIM validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove obsolete nested auto-bump workflow The workflow at Microsoft.SCIM.LogicAppValidationTemplate/.github/workflows/auto-bump-logicapp-version.yml was never active (GitHub Actions only picks up workflows from the repo-root .github/workflows/ directory). It also targeted the deprecated [deprecated]logicAppTemplate.json. Removing to avoid future conflicts with the new StandardLogicApp versioning workflows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add VERSION-driven auto-bump and tag workflows for StandardLogicApp Adds: StandardLogicApp/VERSION (3.0); .github/workflows/standardlogicapp-autobump.yml (auto-bumps VERSION on PRs touching StandardLogicApp/** if not already bumped; honors version:major|minor|patch|skip labels; loop-guarded via [skip-bump] marker; fork-PR safe with manual-bump enforcement); .github/workflows/standardlogicapp-tag.yml (creates tag scim-logicapp-template-vX.Y and a GitHub Release on merge to master when VERSION changes). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: himanshusainig <hsaini@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 544b729 commit 8458dd4

85 files changed

Lines changed: 14265 additions & 103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: StandardLogicApp - Auto-bump VERSION on PR
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
paths:
7+
- 'Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/**'
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
concurrency:
14+
group: standardlogicapp-bump-${{ github.head_ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
autobump:
19+
if: ${{ github.event.pull_request.head.repo.fork == false }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout PR branch
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.head_ref }}
26+
fetch-depth: 0
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Loop guard - skip if last commit was an auto-bump
30+
id: guard
31+
run: |
32+
LAST_MSG=$(git log -1 --pretty=%B)
33+
if echo "$LAST_MSG" | grep -q '\[skip-bump\]'; then
34+
echo "skip=true" >> $GITHUB_OUTPUT
35+
echo "Last commit is an auto-bump. Skipping."
36+
else
37+
echo "skip=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Determine bump type from PR labels
41+
if: steps.guard.outputs.skip != 'true'
42+
id: bumptype
43+
env:
44+
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
45+
run: |
46+
if echo "$LABELS" | grep -q '"version:skip"'; then
47+
echo "type=skip" >> $GITHUB_OUTPUT
48+
elif echo "$LABELS" | grep -q '"version:major"'; then
49+
echo "type=major" >> $GITHUB_OUTPUT
50+
elif echo "$LABELS" | grep -q '"version:patch"'; then
51+
echo "type=patch" >> $GITHUB_OUTPUT
52+
else
53+
echo "type=minor" >> $GITHUB_OUTPUT
54+
fi
55+
56+
- name: Read current and base VERSION
57+
if: steps.guard.outputs.skip != 'true' && steps.bumptype.outputs.type != 'skip'
58+
id: ver
59+
run: |
60+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/VERSION"
61+
CURRENT=$(tr -d '[:space:]' < "$FILE")
62+
git fetch origin ${{ github.base_ref }} --depth=1
63+
BASE=$(git show origin/${{ github.base_ref }}:"$FILE" 2>/dev/null | tr -d '[:space:]' || echo "")
64+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
65+
echo "base=$BASE" >> $GITHUB_OUTPUT
66+
echo "Current PR VERSION: $CURRENT"
67+
echo "Base VERSION: $BASE"
68+
69+
- name: Bump VERSION if unchanged
70+
if: steps.guard.outputs.skip != 'true' && steps.bumptype.outputs.type != 'skip' && steps.ver.outputs.current == steps.ver.outputs.base
71+
id: bump
72+
run: |
73+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/VERSION"
74+
CUR="${{ steps.ver.outputs.current }}"
75+
TYPE="${{ steps.bumptype.outputs.type }}"
76+
77+
MAJOR=$(echo "$CUR" | cut -d. -f1)
78+
MINOR=$(echo "$CUR" | cut -d. -f2)
79+
PATCH=$(echo "$CUR" | cut -d. -f3)
80+
[ -z "$MINOR" ] && MINOR=0
81+
[ -z "$PATCH" ] && PATCH=0
82+
83+
case "$TYPE" in
84+
major) NEW="$((MAJOR+1)).0" ;;
85+
minor) NEW="${MAJOR}.$((MINOR+1))" ;;
86+
patch) NEW="${MAJOR}.${MINOR}.$((PATCH+1))" ;;
87+
esac
88+
89+
echo "$NEW" > "$FILE"
90+
echo "new=$NEW" >> $GITHUB_OUTPUT
91+
echo "Bumping $CUR -> $NEW ($TYPE)"
92+
93+
git config user.name "github-actions[bot]"
94+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
95+
git add "$FILE"
96+
git commit -m "chore(StandardLogicApp): bump VERSION to $NEW [skip-bump]"
97+
git push
98+
99+
- name: Comment resulting version on PR
100+
if: steps.bump.outputs.new != ''
101+
uses: actions/github-script@v7
102+
with:
103+
script: |
104+
const v = '${{ steps.bump.outputs.new }}';
105+
github.rest.issues.createComment({
106+
owner: context.repo.owner,
107+
repo: context.repo.repo,
108+
issue_number: context.issue.number,
109+
body: `🔖 Auto-bumped \`StandardLogicApp/VERSION\` to **${v}**.\nOn merge to master, tag \`scim-logicapp-template-v${v}\` will be created.\n\nTo override, add one of: \`version:major\`, \`version:patch\`, \`version:skip\` and re-run.`
110+
});
111+
112+
- name: Note when author already bumped
113+
if: steps.guard.outputs.skip != 'true' && steps.bumptype.outputs.type != 'skip' && steps.ver.outputs.current != steps.ver.outputs.base && steps.bump.outputs.new == ''
114+
run: |
115+
echo "✅ VERSION already bumped from ${{ steps.ver.outputs.base }} to ${{ steps.ver.outputs.current }}. No action needed."
116+
117+
fork-pr-check:
118+
if: ${{ github.event.pull_request.head.repo.fork == true }}
119+
runs-on: ubuntu-latest
120+
steps:
121+
- uses: actions/checkout@v4
122+
with:
123+
fetch-depth: 0
124+
- name: Require manual VERSION bump for fork PRs
125+
run: |
126+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/VERSION"
127+
git fetch origin ${{ github.base_ref }} --depth=1
128+
CUR=$(tr -d '[:space:]' < "$FILE")
129+
BASE=$(git show origin/${{ github.base_ref }}:"$FILE" 2>/dev/null | tr -d '[:space:]' || echo "")
130+
if [ "$CUR" = "$BASE" ]; then
131+
echo "::error::Fork PRs cannot be auto-bumped. Please bump $FILE manually."
132+
exit 1
133+
fi
134+
echo "✅ VERSION bumped from $BASE to $CUR."
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: StandardLogicApp - Tag on merge to master
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/VERSION'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
tag:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout master
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Read VERSION and create tag
22+
id: tag
23+
run: |
24+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/StandardLogicApp/VERSION"
25+
VERSION=$(tr -d '[:space:]' < "$FILE")
26+
TAG="scim-logicapp-template-v${VERSION}"
27+
28+
echo "VERSION: $VERSION"
29+
echo "TAG: $TAG"
30+
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
echo "tag=$TAG" >> $GITHUB_OUTPUT
32+
33+
if git rev-parse "$TAG" >/dev/null 2>&1; then
34+
echo "::notice::Tag $TAG already exists. Skipping tag creation."
35+
echo "exists=true" >> $GITHUB_OUTPUT
36+
exit 0
37+
fi
38+
echo "exists=false" >> $GITHUB_OUTPUT
39+
40+
git config user.name "github-actions[bot]"
41+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
git tag -a "$TAG" -m "StandardLogicApp $VERSION"
43+
git push origin "$TAG"
44+
echo "✅ Created and pushed tag $TAG"
45+
46+
- name: Create GitHub Release
47+
if: steps.tag.outputs.exists == 'false'
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
tag_name: ${{ steps.tag.outputs.tag }}
51+
name: StandardLogicApp v${{ steps.tag.outputs.version }}
52+
generate_release_notes: true
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
continue-on-error: true

Microsoft.SCIM.LogicAppValidationTemplate/.github/workflows/auto-bump-logicapp-version.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)