For hugo to pull in changes we need to create a pull request. Creating the branch for that is repetitive and can be easily automated, so let's do that. Creating the pull request itself is not as easily automated as it might be necessary to provide a little context for the changes - so let's keep it manual.
20 lines
628 B
Bash
Executable file
20 lines
628 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# requires: push access to the hugo repo in your go path (i.e. your fork must be origin)
|
|
|
|
tag=$(git tag | tail -1)
|
|
|
|
cd ../../gohugoio/hugo
|
|
hugo_tag=$(grep github.com/niklasfasching/go-org go.sum | head -1 | awk '{print $2}')
|
|
|
|
if [[ "$tag" == "$hugo_tag" ]]; then
|
|
echo "tag $tag already exists in hugo"
|
|
exit 1
|
|
fi
|
|
|
|
git checkout -b "update-go-org-to-$tag" origin/master || git reset --hard origin/master
|
|
git pull
|
|
go get "github.com/niklasfasching/go-org@$tag" || exit 1
|
|
sed -i "\_github.com/niklasfasching/go-org ${hugo_tag}_d" go.sum
|
|
git commit -a -m "deps: Update go-org to $tag"
|
|
git push --force-with-lease
|