Merge pull request #137 from meshery/feat/bumpgo #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Meshkit Error Codes Utility Runner | |
on: | |
push: | |
branches: | |
- 'master' | |
paths: | |
- '**.go' | |
jobs: | |
Update-error-codes: | |
name: Error codes utility | |
if: github.repository == 'meshery/meshery-adapter-library' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# token here with write access to meshery-adapter-library repo | |
with: | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
ref: 'master' | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
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 component_info.json in this 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@v3 | |
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/meshery-adapter-library_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/meshery-adapter-library_errors_export.json | |
git commit -m "[Docs] Error Code Reference: Updated codes for Meshery Adapter Library" --signoff | |
git push origin master |