Skip to content

Commit f2652e7

Browse files
committed
[test_operator] Testing my script to update the README.md file to sync variables of test-operator role from defaults/main.yml
This commit will ensure to have the proper auto-sync of README.md with the defaults/main.yml file and also added the post-commit file so whenever someone commits in the defaults/main.yml file the script can be auto-run Ticket: OSPRH-19423 Add edpm-ansible-molecule-edpm_kernel for being tested when molecule change After doing improvements in molecule CI job process [1][2], the edpm_kernel CI job should be working now. [1] #3421 [2] openstack-k8s-operators/edpm-ansible#1048 Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 0ec3565 commit f2652e7

File tree

4 files changed

+282
-205
lines changed

4 files changed

+282
-205
lines changed

.githooks/post-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# Run README sync only if defaults/main.yml changed in the last commit
3+
4+
if git diff-tree --no-commit-id --name-only -r HEAD | grep -q "roles/test_operator/defaults/main.yml"; then
5+
echo "🧩 Detected change in defaults/main.yml — syncing README..."
6+
python3 roles/test_operator/sync_test_operator_var_readme.py
7+
git add roles/test_operator/README.md
8+
echo "✅ README.md updated and staged."
9+
else
10+
echo "No changes in defaults/main.yml — skipping README sync."
11+
fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ Unless required by applicable law or agreed to in writing, software
2727
distributed under the License is distributed on an "AS IS" BASIS,
2828
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2929
See the License for the specific language governing permissions and
30-
limitations under the License.
30+
limitations under the License.

0 commit comments

Comments
 (0)