Merge pull request #12020 from dragon-slayer875/master #23
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: Meshery extensions go.mod sync | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "master" | |
paths: | |
- "go.mod" | |
jobs: | |
sync: | |
if: github.repository == 'meshery/meshery' | |
name: sync | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: check out code for meshery | |
uses: actions/checkout@master | |
with: | |
repository: meshery/meshery | |
token: ${{ secrets.RELEASEDRAFTER_PAT }} | |
path: meshery | |
- name: Check out code for meshery-extensions | |
uses: actions/checkout@master | |
with: | |
repository: layer5labs/meshery-extensions | |
token: ${{ secrets.RELEASEDRAFTER_PAT }} | |
path: meshery-extensions | |
- name: Setup Go | |
uses: actions/setup-go@master | |
with: | |
go-version: "1.21" | |
- name: Go mod sync utility | |
run: cd meshery-extensions;make graphql-sync; | |
- name: Pull changes from remote | |
working-directory: ./meshery-extensions | |
run: git pull origin master | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
repository: meshery-extensions | |
commit_user_name: l5io | |
commit_user_email: [email protected] | |
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
commit_options: '--signoff' | |
commit_message: 'Upgrading go.mod in response to meshery/meshery' | |
branch: master | |
notify-via-email: | |
runs-on: ubuntu-latest | |
needs: | |
- sync | |
if: ${{ always() && contains(needs.*.result, 'failure') }} | |
steps: | |
- name: Send email notification on failure | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.gmail.com | |
server_port: 465 | |
username: ${{ secrets.MAIL_USERNAME }} | |
password: ${{ secrets.MAIL_PASSWORD }} | |
subject: Go Mod Sync Failed - ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }} | |
to: [email protected] | |
from: Meshery extensions go.mod sync workflow | |
body: | | |
The workflow (https://github.com/meshery/meshery/actions/workflows/go-mod-sync.yml) encountered error(s). This mainly occurs when the go.mod file in the meshery-extensions repository is not in sync with the go.mod file in the meshery/meshery repository. The workflow attempts to update the go.mod file in the meshery-extensions repository to ensure it matches the go.mod file in the meshery/meshery repository. | |
The workflow failed. Here are the details: | |
Job Status: ${{ job.status }} | |
Repository: ${{ github.repository }} | |
Run ID: ${{ github.run_id }} | |
Workflow Name: ${{ github.workflow }} | |
Steps and their outcomes: | |
${{ toJson(job.steps) }} | |
Refer to the GitHub Actions log for more details: https://github.com/meshery/meshery/actions/runs/${{ github.run_id }} |