Install script enhancement #72
Workflow file for this run
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" | |
pull_request: | |
branches: | |
- "master" | |
paths: | |
- "**.go" | |
jobs: | |
Update-error-codes: | |
name: Error codes utility | |
if: github.repository == 'meshery/helm-kanvas-snapshot' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@master | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
ref: "master" | |
fetch-depth: 1 | |
- uses: actions/checkout@master | |
if: ${{ github.event_name == 'push' }} | |
with: | |
ref: "master" | |
fetch-depth: 1 | |
- name: Setup Go | |
uses: actions/setup-go@master | |
with: | |
go-version: "1.21" | |
- name: Build Error Utility | |
run: | | |
go get github.com/layer5io/meshkit/cmd/errorutil@master | |
go build -o ~/errorutil github.com/layer5io/meshkit/cmd/errorutil | |
- name: Run Utility For Plugin | |
run: | | |
~/errorutil update -d . -i ./helpers -o ./helpers | |
output=$(~/errorutil -d . analyze -i ./helpers -o ./helpers | wc -c) | |
if [ "$output" -ne 0 ]; then | |
exit 1 | |
fi | |
echo '{ "errors_export": "" }' | jq --slurpfile export ./helpers/errorutil_errors_export.json '.errors_export = $export[0]' > ./helpers/errorutil_errors_export.json | |
- name: Pull changes from remote | |
run: git pull origin master | |
- name: Commit changes | |
if: ${{ github.event_name != 'pull_request' }} # Skip for pull requests | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: helpers | |
commit_user_name: l5io | |
commit_user_email: ci@layer5.io | |
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
commit_options: "--signoff" | |
commit_message: "[Error Codes]: Update Helm Kanvas Snapshot error codes and reference" |