@@ -110,3 +110,76 @@ jobs:
110110
111111 permissions :
112112 contents : write
113+
114+ update-wiki :
115+ needs :
116+ - check
117+ runs-on : ubuntu-latest
118+ if : always() && github.ref == 'refs/heads/main'
119+ steps :
120+ - name : Checkout repository
121+ uses : actions/checkout@v5
122+
123+ - name : Checkout wiki
124+ uses : actions/checkout@v5
125+ with :
126+ repository : ${{ github.repository }}.wiki
127+ path : wiki
128+ token : ${{ secrets.GITHUB_TOKEN }}
129+
130+ - name : Download compatibility report
131+ uses : actions/download-artifact@v4
132+ with :
133+ name : compatibility-report
134+ path : ./
135+
136+ - name : Verify compatibility report
137+ run : |
138+ if [ -f "compatibility-report.md" ]; then
139+ echo "Successfully downloaded compatibility-report.md"
140+ else
141+ echo "compatibility-report.md not found, failing workflow"
142+ exit 1
143+ fi
144+
145+ - name : Update wiki page
146+ run : |
147+ cd wiki
148+
149+ # Configure git
150+ git config user.name "GitHub Actions Bot"
151+ git config user.email "github-actions[bot]@users.noreply.github.com"
152+
153+ # Copy the generated markdown to wiki
154+ cp ../compatibility-report.md "Backstage-Compatibility-Report.md"
155+
156+ # Check if there are changes
157+ if ! git diff --quiet; then
158+ # Add the file
159+ git add "Backstage-Compatibility-Report.md"
160+
161+ # Calculate counts for commit message
162+ required_count=$(echo "${INPUT_INCOMPATIBLE_REQUIRED_WORKSPACES}" | wc -w)
163+ unrequired_count=$(echo "${INPUT_INCOMPATIBLE_UNREQUIRED_WORKSPACES}" | wc -w)
164+ total_count=$((required_count + unrequired_count))
165+
166+ git commit -m "Update Backstage Compatibility Report
167+
168+ - Total incompatible: ${total_count}
169+ - Required: ${required_count}
170+ - Optional: ${unrequired_count}
171+
172+ Generated from: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}"
173+ git push
174+ echo "Wiki page updated successfully"
175+ else
176+ echo "No changes detected, wiki page is up to date"
177+ fi
178+ env :
179+ INPUT_INCOMPATIBLE_REQUIRED_WORKSPACES : ${{ needs.check.outputs.incompatible-required-workspaces }}
180+ INPUT_INCOMPATIBLE_UNREQUIRED_WORKSPACES : ${{ needs.check.outputs.incompatible-unrequired-workspaces }}
181+ GITHUB_SERVER_URL : ${{ github.server_url }}
182+ GITHUB_REPOSITORY : ${{ github.repository }}
183+
184+ permissions :
185+ contents : write
0 commit comments