diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d343da197b..c1a3847ae1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -15,9 +15,7 @@ # name: Run formatter on: - push: - branches: - - main + pull_request: jobs: dump-contexts-to-log: @@ -65,28 +63,11 @@ jobs: make format git checkout go.mod go.sum - - name: Check and Push to main branch - continue-on-error: true + - name: Check git difference run: | if git diff --quiet --exit-code; then echo "Nothing updated" else - git add . - git commit -S --signoff -m ":robot: Update license headers / Format Go codes and YAML files" - - git remote set-url origin "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - git push -u origin ${BRANCH_NAME} - - curl --include --verbose --fail \ - -H "Accept: application/json" \ - -H "Content-Type:application/json" \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - --request POST \ - --data "{\"title\": \"Update license headers / Format codes\", \"head\": \"${BRANCH_NAME}\", \"base\": \"main\", \"body\": \"Update license headers / Format Go codes and YAML files.\", \"maintainer_can_modify\": true}" \ - $API_URL + echo "Please execute \`make format\` locally." + exit 1 fi - env: - GITHUB_USER: ${{ secrets.DISPATCH_USER }} - GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} - API_URL: https://api.github.com/repos/vdaas/vald/pulls - BRANCH_NAME: ${{ steps.switch_to_new_branch.outputs.BRANCH_NAME }} diff --git a/Makefile.d/helm.mk b/Makefile.d/helm.mk index 663a71ed54..9d69b9063e 100644 --- a/Makefile.d/helm.mk +++ b/Makefile.d/helm.mk @@ -29,8 +29,8 @@ helm-docs/install: $(BINDIR)/helm-docs $(BINDIR)/helm-docs: mkdir -p $(BINDIR) cd $(TEMP_DIR) \ - && curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(UNAME)_$(ARCH).tar.gz \ - && tar xzvf helm-docs_$(UNAME)_$(ARCH).tar.gz \ + && curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_$(UNAME)_$(ARCH).tar.gz \ + && tar xzvf helm-docs_$(HELM_DOCS_VERSION)_$(UNAME)_$(ARCH).tar.gz \ && mv helm-docs $(BINDIR)/helm-docs .PHONY: helm/package/vald