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

add error codes utility runner workflow #180

Merged
merged 1 commit into from
Jul 26, 2021
Merged
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
66 changes: 66 additions & 0 deletions .github/workflows/error-codes-updater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Consul Error Codes Utility Runner
on:
push:
branches:
- 'master'
paths:
- '**.go'

jobs:
Update-error-codes:
name: Error codes utility
if: github.repository == 'meshery/meshery-consul'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# token here with write access to consul repo
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: 'master'

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ secrets.GO_VERSION }}

- name: Run utility
run: |
go get github.com/layer5io/meshkit/cmd/errorutil
go run github.com/layer5io/meshkit/cmd/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers

# to update errorutil* files in consul repo
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: 'run error codes utility'
file_pattern: helpers/ **.go

# to push changes to meshery docs
- name: Checkout meshery
uses: actions/checkout@v2
with:
repository: 'meshery/meshery'
# token with write access to meshery repository
token: ${{ secrets.GH_ACCESS_TOKEN }}
path: 'meshery'
ref: 'master'

- name: Update and push docs
run: |
echo '{ "errors_export": "" }' | jq --slurpfile export ./helpers/errorutil_errors_export.json '.errors_export = $export[0]' > ./meshery/docs/_data/errorref/consul_errors_export.json

cd ./meshery
git config user.name l5io
git config user.email [email protected]
if git diff --exit-code --quiet
then
echo "No changes to commit"
exit
fi
git add ./docs/_data/errorref/consul_errors_export.json
git commit -m "[Docs] Error Code Reference: Updated codes for Consul adapter" --signoff
git push origin master
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ meshery-consul

log.txt

.idea
.idea

**errorutil_analyze_errors.json
**errorutil_analyze_summary.json
**errorutil_errors_export.json
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ run:

.PHONY: error
error:
go run github.com/layer5io/meshkit/cmd/errorutil -d . update
go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers
39 changes: 0 additions & 39 deletions errorutil_analyze_errors.json

This file was deleted.

11 changes: 0 additions & 11 deletions errorutil_analyze_summary.json

This file was deleted.

15 changes: 0 additions & 15 deletions errorutil_errors_export.json

This file was deleted.

File renamed without changes.