Skip to content

Commit 2f9c772

Browse files
authored
Merge pull request #89 from layer5io/copilot/fix-f6932051-4c67-4bb6-8de2-cfe65b2bac6f
Fix broken build-and-release.yml workflow: resolve undefined variables and compatibility issues
2 parents 6da3ca5 + 33c1288 commit 2f9c772

19 files changed

+19
-22
lines changed

.github/workflows/build-and-release.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,20 @@ jobs:
4949
fi
5050
5151
echo "✅ Found module for orgId '$ORG_ID': $MODULE"
52+
53+
# Set environment variables for later steps
54+
echo "ACADEMY_NAME=${MODULE##*/}" >> $GITHUB_ENV
55+
echo "NOTES=Updated from academy-build workflow" >> $GITHUB_ENV
56+
5257
make update-module module="$MODULE" version="$VERSION"
5358
make update-org-to-module-version orgId="$ORG_ID" version="$VERSION"
5459
60+
- name: Set default environment variables
61+
if: ${{ github.event.inputs.orgId == '' }}
62+
run: |
63+
echo "ACADEMY_NAME=Layer5 Academy" >> $GITHUB_ENV
64+
echo "NOTES=Manual build from academy-build workflow" >> $GITHUB_ENV
65+
5566
- name: Install dependencies
5667
run: make setup
5768

@@ -104,26 +115,21 @@ jobs:
104115
with:
105116
token: ${{ secrets.GH_ACCESS_TOKEN }}
106117
path: meshery-cloud
107-
commit-message: "Add ${ACADEMY_NAME} release v${{ github.event.inputs.version || 'latest' }}: $NOTES [CI]"
108-
title: "${ACADEMY_NAME} v${{ github.event.inputs.version || 'latest' }}: $NOTES"
109-
body: "Automated PR for ${ACADEMY_NAME} release v${{ github.event.inputs.version || 'latest' }} from academy-build. OrgId: ${{ github.event.inputs.orgId || 'manual' }}."
118+
commit-message: "Add ${{ env.ACADEMY_NAME }} release v${{ github.event.inputs.version || 'latest' }}: ${{ env.NOTES }} [CI]"
119+
title: "${{ env.ACADEMY_NAME }} v${{ github.event.inputs.version || 'latest' }}: ${{ env.NOTES }}"
120+
body: "Automated PR for ${{ env.ACADEMY_NAME }} release v${{ github.event.inputs.version || 'latest' }} from academy-build. OrgId: ${{ github.event.inputs.orgId || 'manual' }}."
110121
branch: academy-release-v${{ github.event.inputs.version || 'latest' }}
111122
labels: academy
112123

113124
- name: Auto-merge PR in meshery-cloud repo
114125
if: github.event.inputs.version != ''
115126
run: |
116-
PR_NUMBER=$(jq -r .pull_request_number <<< "${{ steps.cpr.outputs.pull-request-number }}")
117-
if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" = "null" ]; then
118-
PR_NUMBER=$(jq -r .pull_request_number <<< "${{ steps.cpr.outputs.pr }}" || true)
119-
fi
120-
if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" = "null" ]; then
121-
PR_NUMBER="${{ steps.cpr.outputs.pull-request-number }}"
122-
fi
123-
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
127+
PR_NUMBER="${{ steps.cpr.outputs.pull-request-number }}"
128+
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ] && [ "$PR_NUMBER" != "" ]; then
129+
echo "Auto-merging PR #$PR_NUMBER"
124130
gh pr merge "$PR_NUMBER" --merge --repo layer5io/meshery-cloud --admin --delete-branch
125131
else
126-
echo "No PR created to auto-merge."
132+
echo "No PR number found, skipping auto-merge."
127133
fi
128134
env:
129135
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ node_modules/
2828
node_modules/
2929
public/
3030
.hugo_build.lock
31+
resources/_gen/

resources/_gen/assets/scss/main.scss_a7b64cfe358ca0f98a9b572608f3a01d.content

Lines changed: 0 additions & 9 deletions
This file was deleted.

resources/_gen/assets/scss/main.scss_a7b64cfe358ca0f98a9b572608f3a01d.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)