-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate-workflows.sh
More file actions
executable file
·44 lines (36 loc) · 1.05 KB
/
update-workflows.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Helper for maintainers: commit + push changes in the Workflow-Scripts repo.
#
# This script intentionally does NOT touch the parent project repo.
#
# Usage:
# ./Workflow-Scripts/update-workflows.sh "docs: clarify workflow instructions"
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMMIT_MSG="${1:-}"
cd "$SCRIPT_DIR"
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "Error: '$SCRIPT_DIR' is not a git repository."
exit 1
fi
if [ -z "$COMMIT_MSG" ]; then
echo "No commit message provided."
echo "Review and commit manually:"
echo " cd Workflow-Scripts"
echo " git status"
echo " git add ."
echo " git commit -m 'docs: ...'"
echo " git push"
exit 1
fi
if [ -n "$(git diff --name-only)" ]; then
echo "Error: you have unstaged changes. Stage them first (git add ...)."
exit 1
fi
if git diff --cached --quiet; then
echo "Error: no staged changes to commit."
exit 1
fi
git commit -m "$COMMIT_MSG"
git push
echo "Workflow-Scripts changes pushed."