Skip to content

Commit ca7c34e

Browse files
joelhawksleyCopilot
andcommitted
Fix release script and workflow
- Fix DEPRECATION_HORIZON sed pattern in script/release to match the quoted version string (e.g. "5.0.0") instead of matching zero digits before the opening quote, which produced invalid Ruby like DEPRECATION_HORIZON = 5"5.0.0". - Drop --web from 'gh pr create' so it works on headless CI runners (xdg-open is unavailable) and pass an explicit --body. - Set persist-credentials: true on the release job checkout so the automated 'git push' can authenticate with GITHUB_TOKEN. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
1 parent c6a8129 commit ca7c34e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
with:
110110
fetch-depth: 0
111111
token: ${{ secrets.GITHUB_TOKEN }}
112-
persist-credentials: false
112+
persist-credentials: true
113113

114114
- name: Set up Ruby
115115
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b

‎script/release‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ update_ruby_version() {
4949
# Update deprecation horizon version
5050
major=$1
5151
sed -i \
52-
-e "s/DEPRECATION_HORIZON = [0-9]*/DEPRECATION_HORIZON = $((major + 1))/g" \
52+
-e "s/DEPRECATION_HORIZON = \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/DEPRECATION_HORIZON = \"$((major + 1)).0.0\"/g" \
5353
lib/view_component/deprecation.rb
5454
}
5555

@@ -91,10 +91,10 @@ push() {
9191
# Open PR
9292
pr_url=$(gh pr create \
9393
--title "Release $1.$2.$3" \
94+
--body "Automated release PR for version $1.$2.$3." \
9495
--base main \
9596
--head release-$1-$2-$3 \
96-
--repo ViewComponent/view_component \
97-
--web)
97+
--repo ViewComponent/view_component)
9898

9999
echo "####################################################"
100100
echo "PR opened: $pr_url"

0 commit comments

Comments
 (0)