Skip to content

Commit

Permalink
ci: allow skipping some emacs submodule updates (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhoy authored Mar 4, 2025
1 parent d12502c commit 5ba6c00
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [main]
pull_request:
types: [ready_for_review, opened, syncronize, reopened]
types: [ready_for_review, opened, synchronize, reopened]
jobs:
build:
runs-on: macos-latest
Expand Down
37 changes: 35 additions & 2 deletions scripts/update-submodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,34 @@

set -eoux pipefail

# The following won't get auto-updated.
SKIP_SUBMODULES="yaml markdown-mode"

export SKIP_SUBMODULES

DRY_RUN=false

while [[ $# -gt 0 ]]; do
case $1 in
--dry-run)
DRY_RUN=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--dry-run]"
exit 1
;;
esac
done

echo $DRY_RUN

function update() {
if [[ " $SKIP_SUBMODULES " =~ " $name " ]]; then
echo "skipping $name as set in SKIP_SUBMODULES"
return 0
fi
branch=$(git rev-parse --abbrev-ref HEAD)
git fetch origin
local_sha=$(git rev-parse ${branch})
Expand All @@ -21,8 +48,14 @@ function update() {
git submodule update --remote -- $sm_path
git add $sm_path
git commit -m "bump ${name} ${date}"
git push origin $update_branch -u
gh pr create --draft --title "bump ${name} ${date}" --body "Compare: ${diff_url}" -B $top_branch

if $DRY_RUN; then
echo "[dry run] git push origin $update_branch -u"
echo "[dry run] gh pr create --draft --title \"bump ${name} ${date}\" --body \"Compare: ${diff_url}\" -B $top_branch"
else
git push origin $update_branch -u
gh pr create --draft --title "bump ${name} ${date}" --body "Compare: ${diff_url}" -B $top_branch
fi
git checkout $top_branch
fi
}
Expand Down

0 comments on commit 5ba6c00

Please sign in to comment.