Skip to content

Commit

Permalink
update format chatops (#2021)
Browse files Browse the repository at this point in the history
Signed-off-by: kevindiu <[email protected]>
  • Loading branch information
kevindiu authored May 2, 2023
1 parent e0240ba commit 9b2f756
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ jobs:
with:
go-version: ${{ steps.golang_version.outputs.version }}
- name: update and push
id: format_push
if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true'
run: |
export PATH=$(go env GOPATH)/bin:$PATH
Expand All @@ -478,8 +479,10 @@ jobs:
git checkout go.mod go.sum
if git diff --quiet --exit-code; then
echo "UPDATED=false" >> $GITHUB_OUTPUT
echo "Nothing updated"
else
echo "UPDATED=true" >> $GITHUB_OUTPUT
git add .
git commit -S --signoff -m ":robot: Update license headers / Format go codes and yaml files"
Expand All @@ -492,6 +495,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
PR_INFO_URL: ${{ github.event.issue.pull_request.url }}
PR_NUM: ${{ github.event.issue.number }}
- name: no changes
if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true' && steps.format_push.outputs.UPDATED == 'false'
run: |
curl --include --verbose --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request POST \
--data "{\"body\": \"**[FORMAT]** Nothing to format.\"}" \
$API_URL
env:
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
API_URL: ${{ github.event.issue.comments_url }}
- name: failure comment
if: failure()
run: |
Expand Down

0 comments on commit 9b2f756

Please sign in to comment.