Skip to content

Commit 4c6a8be

Browse files
Adding a version bump and tag creation logic, marking the setup instructions as deprecated (#125)
* Add files via upload * Added Setup instructions * Add saini.txt with greeting message * Added referred images * Delete Microsoft.SCIM.LogicAppValidationTemplate/images/saini.txt * Remove permission assignment script and add reference linkUp Removed the script for assigning permissions to the Logic app and added a reference link for role assignment. * Delete Microsoft.SCIM.LogicAppValidationTemplate/SetupLogicApp_Full.md * Delete Microsoft.SCIM.LogicAppValidationTemplate/SetupLogicApp_Clean.md * Delete Microsoft.SCIM.LogicAppValidationTemplate/images directory * Add sample.txt with initial content * Added media files * Added setup instructions cleaned * updated logic app for * Add files via upload updated setup instruction for post run sharing of logic app run data * updated images * Adding validation script * updating the logic app template with more params managersupported - variable to skip manager test * fixing the link to validation script * updating setup instructions with post run steps and FAQ * updating assets for logic app setup instructions * Updated template to have fields from schema, added version and getschema call * Update Logic App version from 1.0.0 to 3.0 * Fixed manager test to fail in case the remove manager fails Fixed manager test to fail in case the remove manager fails * Rename SetupLogicApp.md to [Deprecated]SetupLogicApp.md * Add auto-bump version workflow for LogicApp This workflow automates the version bumping of the LogicAppVersion in the logicAppTemplate.json file on pull requests and creates a Git tag upon merging to the master branch.
1 parent d6f7ed8 commit 4c6a8be

2 files changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Auto-bump SCIM LogicApp Version and Tag
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'Microsoft.SCIM.LogicAppValidationTemplate/logicAppTemplate.json'
7+
8+
push:
9+
branches: [master]
10+
paths:
11+
- 'Microsoft.SCIM.LogicAppValidationTemplate/logicAppTemplate.json'
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
18+
# ─────────────────────────────────────────────────────────
19+
# Job 1: Auto-bump version in PR if not already bumped
20+
# ─────────────────────────────────────────────────────────
21+
auto-bump:
22+
if: github.event_name == 'pull_request'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout PR branch
26+
uses: actions/checkout@v4
27+
with:
28+
ref: ${{ github.head_ref }}
29+
fetch-depth: 0
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Check and auto-bump LogicAppVersion
33+
run: |
34+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/logicAppTemplate.json"
35+
36+
# Get version from the PR branch
37+
CURRENT=$(jq -r '.parameters.LogicAppVersion.defaultValue' "$FILE")
38+
39+
# Get version from master (base branch)
40+
git show origin/master:"$FILE" > /tmp/old.json 2>/dev/null
41+
OLD=$(jq -r '.parameters.LogicAppVersion.defaultValue' /tmp/old.json 2>/dev/null || echo "0.0")
42+
43+
echo "Master version: $OLD"
44+
echo "PR version: $CURRENT"
45+
46+
if [ "$CURRENT" == "$OLD" ]; then
47+
# Version not bumped — auto-increment the minor version
48+
MAJOR=$(echo "$OLD" | cut -d. -f1)
49+
MINOR=$(echo "$OLD" | cut -d. -f2)
50+
NEW_MINOR=$((MINOR + 1))
51+
NEW_VERSION="${MAJOR}.${NEW_MINOR}"
52+
53+
echo "⚙️ Auto-bumping LogicAppVersion to $NEW_VERSION"
54+
55+
# Update the file
56+
jq --arg v "$NEW_VERSION" \
57+
'.parameters.LogicAppVersion.defaultValue = $v' "$FILE" > /tmp/updated.json
58+
mv /tmp/updated.json "$FILE"
59+
60+
# Commit and push back to the PR branch
61+
git config user.name "github-actions[bot]"
62+
git config user.email "github-actions[bot]@users.noreply.github.com"
63+
git add "$FILE"
64+
git commit -m "Auto-bump LogicAppVersion to $NEW_VERSION [skip ci]"
65+
git push
66+
67+
echo "✅ LogicAppVersion bumped to $NEW_VERSION and pushed to PR branch."
68+
else
69+
echo "✅ LogicAppVersion already bumped from $OLD to $CURRENT. No action needed."
70+
fi
71+
72+
# ─────────────────────────────────────────────────────────
73+
# Job 2: Create Git tag when merged to master
74+
# ─────────────────────────────────────────────────────────
75+
create-tag:
76+
if: github.event_name == 'push'
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Checkout master
80+
uses: actions/checkout@v4
81+
with:
82+
fetch-depth: 0
83+
84+
- name: Create version tag
85+
run: |
86+
FILE="Microsoft.SCIM.LogicAppValidationTemplate/logicAppTemplate.json"
87+
VERSION=$(jq -r '.parameters.LogicAppVersion.defaultValue' "$FILE")
88+
TAG_NAME="scim-logicapp-template-v${VERSION}"
89+
90+
echo "LogicAppVersion: $VERSION"
91+
echo "Tag name: $TAG_NAME"
92+
93+
# Check if tag already exists
94+
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
95+
echo "❌ Tag $TAG_NAME already exists!"
96+
echo "This indicates a version collision — LogicAppVersion was not properly bumped."
97+
exit 1
98+
fi
99+
100+
# Create and push the tag
101+
git tag "$TAG_NAME"
102+
git push origin "$TAG_NAME"
103+
echo "✅ Tag $TAG_NAME created and pushed successfully."

Microsoft.SCIM.LogicAppValidationTemplate/SetupLogicApp.md renamed to Microsoft.SCIM.LogicAppValidationTemplate/[Deprecated]SetupLogicApp.md

File renamed without changes.

0 commit comments

Comments
 (0)