Skip to content

Commit ae93d8e

Browse files
authored
Merge pull request #1403 from polasudo/feat/RHIDP-8649
feat: Update a wiki page with the compatibility check markdown
2 parents a34d55b + 38be359 commit ae93d8e

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

.github/workflows/check-backstage-compatibility.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Target Backstage Compatibility Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fredhat-developer%2Frhdh-plugin-export-overlays%2Frefs%2Fheads%2Fmetadata%2Fincompatible-workspaces.json&style=flat&cacheSeconds=60)](https://github.com/redhat-developer/rhdh-plugin-export-overlays/actions/workflows/check-backstage-compatibility.yaml?query=event%3Apush)
1+
[![Target Backstage Compatibility Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fredhat-developer%2Frhdh-plugin-export-overlays%2Frefs%2Fheads%2Fmetadata%2Fincompatible-workspaces.json&style=flat&cacheSeconds=60)](https://github.com/redhat-developer/rhdh-plugin-export-overlays/wiki/Backstage-Compatibility-Report)
22

33
[![Publish Images Badge](https://img.shields.io/github/actions/workflow/status/redhat-developer/rhdh-plugin-export-overlays/publish-workspace-plugins.yaml?branch=main&event=push&label=Publish%20RHDH%20Next%20Release%20Dynamic%20Plugin%20Images)](https://github.com/redhat-developer/rhdh-plugin-export-overlays/actions/workflows/publish-workspace-plugins.yaml?query=event%3Apush)
44

0 commit comments

Comments
 (0)