Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable format PR creation #2213

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 4 additions & 23 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#
name: Run formatter
on:
push:
branches:
- main
pull_request:

jobs:
dump-contexts-to-log:
Expand Down Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions Makefile.d/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down