Skip to content

Commit

Permalink
run sed once to replace all versions in a file
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 23, 2024
1 parent 83b81d5 commit 0b49da7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/bump-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ echo "Updating $pre_commit_hook"
sed_ "s/entry: docker\\.io\\/rhysd\\/actionlint:.*/entry: docker.io\\/rhysd\\/actionlint:${version}/" "$pre_commit_hook"

echo "Updating $usage_doc"
sed_ "s/ rev: v[0-9]+\.[0-9]+\.[0-9]+/ rev: v${version}/" "$usage_doc"
sed_ "s/actionlint@[0-9]+\.[0-9]+\.[0-9]+/actionlint@${version}/g" "$usage_doc"
sed_ "s/\`actionlint:[0-9]+\.[0-9]+\.[0-9]+\`/\`actionlint:${version}\`/g" "$usage_doc"
sed_ "\
s/ rev: v[0-9]+\.[0-9]+\.[0-9]+/ rev: v${version}/; \
s/ actionlint@[0-9]+\.[0-9]+\.[0-9]+/ actionlint@${version}/g; \
s/\`actionlint:[0-9]+\.[0-9]+\.[0-9]+\`/\`actionlint:${version}\`/g; \
" "$usage_doc"

echo 'Creating a version bump commit and a version tag'
git add "$pre_commit_hook" "$usage_doc"
Expand Down

0 comments on commit 0b49da7

Please sign in to comment.