Skip to content

Commit 50ed5d1

Browse files
patrickleethoushengbo
authored andcommitted
feat: add workflow_dispatch to publish helm workflow, remove unneeded fetch (knative#1977)
1 parent 43e502b commit 50ed5d1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/publish-helm.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
release:
55
types: [published]
66

7+
workflow_dispatch:
8+
79
jobs:
810
release:
911

@@ -32,21 +34,17 @@ jobs:
3234
mv hack/find_helm_chart_releases_and_create_helm_index.sh ../.tmp/
3335
mv hack/gh-pages.tmpl ../.tmp/
3436
35-
PAGES_BRANCH="gh-pages"
36-
37-
git fetch --all --tags
38-
39-
if git show-ref --verify --quiet refs/heads/$PAGES_BRANCH || git ls-remote --exit-code --heads origin $PAGES_BRANCH; then
37+
if git show-ref --verify --quiet refs/heads/gh-pages || git ls-remote --exit-code --heads origin gh-pages; then
4038
# Branch exists
41-
git checkout $PAGES_BRANCH
42-
echo "Checked out existing branch '$PAGES_BRANCH'"
39+
git checkout gh-pages
40+
echo "Checked out existing branch 'gh-pages'"
4341
else
4442
# Branch does not exist
45-
git symbolic-ref HEAD refs/heads/$PAGES_BRANCH
43+
git symbolic-ref HEAD refs/heads/gh-pages
4644
rm .git/index
4745
git clean -fdx
4846
echo ".tmp/" > .gitignore
49-
echo "Created and checked out new branch '$PAGES_BRANCH'"
47+
echo "Created and checked out new branch 'gh-pages'"
5048
fi
5149
5250
mv ../.tmp ./

0 commit comments

Comments
 (0)