Skip to content

Commit 6c999b6

Browse files
committed
Update release.sh to use branch + PR instead of pushing to main
Branch protection on the public repo requires PR approval for all changes to main. The script now creates a release/vX.Y.Z branch, commits, pushes, and opens a PR. After merge, the maintainer creates a GitHub release which tags the merge commit on main.
1 parent db179a0 commit 6c999b6

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,11 @@ Releasing these skills is easy! Just run the following command:
324324
./release.sh
325325
```
326326

327-
This walks you through a semantic version bump (major/minor/patch), updates the version in `plugin.json`, `marketplace.json`, README badge, all `SKILL.md` files, and the CHANGELOG date, then commits, tags, and pushes. After it finishes, create a GitHub release for the tag at the URL it prints.
327+
This walks you through a semantic version bump (major/minor/patch), updates the version in `plugin.json`, `marketplace.json`, README badge, all `SKILL.md` files, and the CHANGELOG date, then creates a release branch and PR. After the PR is approved and merged, create a GitHub release to tag main:
328+
329+
```bash
330+
gh release create v<version> --target main --title "v<version>" --generate-notes
331+
```
328332

329333
## License
330334

release.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,22 +154,23 @@ main() {
154154
printf "${YELLOW}${RESET} No [${NEXT_VERSION}] - TBD entry found in CHANGELOG.md (already dated?)\n"
155155
fi
156156

157-
printf "\n${BLUE}Step 5: Commit and tag${RESET}\n"
157+
printf "\n${BLUE}Step 5: Commit and create PR${RESET}\n"
158+
local release_branch="release/v${NEXT_VERSION}"
159+
git checkout -b "$release_branch"
158160
git add "$PLUGIN_JSON" "$MARKETPLACE_JSON" "$SCRIPT_DIR/README.md" "$SCRIPT_DIR/skills"/*/SKILL.md "$SCRIPT_DIR/CHANGELOG.md"
159161
git commit -m "Release v${NEXT_VERSION}"
160-
git tag -a "v${NEXT_VERSION}" -m "Release v${NEXT_VERSION}"
161-
printf "${GREEN}${RESET} Committed and tagged v${NEXT_VERSION}\n"
162-
163-
printf "\n${BLUE}Step 6: Push commit and tag to %s${RESET}\n" "$remote"
164-
git push "$remote" main
165-
git push "$remote" "v${NEXT_VERSION}"
166-
printf "${GREEN}${RESET} Pushed to %s\n" "$remote"
167-
168-
printf "\n${BLUE}Step 7: Marketplace PR${RESET}\n"
169-
printf "\nTo complete the release, create a GitHub release:\n"
170-
printf " https://github.com/CrowdStrike/foundry-skills/releases/new?tag=v${NEXT_VERSION}\n\n"
171-
printf "The tag v${NEXT_VERSION} has been pushed. Create a release with release notes.\n\n"
172-
printf "After the release is published, users get the update on next 'git pull'.\n\n"
162+
printf "${GREEN}${RESET} Committed v${NEXT_VERSION}\n"
163+
164+
printf "\n${BLUE}Step 6: Push branch and create PR${RESET}\n"
165+
git push -u "$remote" "$release_branch"
166+
gh pr create --title "Release v${NEXT_VERSION}" --body "Version bump to v${NEXT_VERSION}."
167+
printf "${GREEN}${RESET} PR created\n"
168+
git checkout main
169+
170+
printf "\n${BLUE}Step 7: After PR merges${RESET}\n"
171+
printf "\nOnce the PR is approved and merged, create a GitHub release:\n"
172+
printf " gh release create v${NEXT_VERSION} --target main --title \"v${NEXT_VERSION}\" --generate-notes\n\n"
173+
printf "This tags the merge commit on main and publishes release notes.\n\n"
173174
printf "${GREEN}Done.${RESET}\n"
174175
}
175176

0 commit comments

Comments
 (0)