Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/check-backstage-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,76 @@ jobs:

permissions:
contents: write

update-wiki:
needs:
- check
runs-on: ubuntu-latest
if: always() && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Checkout wiki
uses: actions/checkout@v5
with:
repository: ${{ github.repository }}.wiki
path: wiki
token: ${{ secrets.GITHUB_TOKEN }}

- name: Download compatibility report
uses: actions/download-artifact@v4
with:
name: compatibility-report
path: ./

- name: Verify compatibility report
run: |
if [ -f "compatibility-report.md" ]; then
echo "Successfully downloaded compatibility-report.md"
else
echo "compatibility-report.md not found, failing workflow"
exit 1
fi

- name: Update wiki page
run: |
cd wiki

# Configure git
git config user.name "GitHub Actions Bot"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Copy the generated markdown to wiki
cp ../compatibility-report.md "Backstage-Compatibility-Report.md"

# Check if there are changes
if ! git diff --quiet; then
# Add the file
git add "Backstage-Compatibility-Report.md"

# Calculate counts for commit message
required_count=$(echo "${INPUT_INCOMPATIBLE_REQUIRED_WORKSPACES}" | wc -w)
unrequired_count=$(echo "${INPUT_INCOMPATIBLE_UNREQUIRED_WORKSPACES}" | wc -w)
total_count=$((required_count + unrequired_count))

git commit -m "Update Backstage Compatibility Report

- Total incompatible: ${total_count}
- Required: ${required_count}
- Optional: ${unrequired_count}

Generated from: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}"
git push
echo "Wiki page updated successfully"
else
echo "No changes detected, wiki page is up to date"
fi
env:
INPUT_INCOMPATIBLE_REQUIRED_WORKSPACES: ${{ needs.check.outputs.incompatible-required-workspaces }}
INPUT_INCOMPATIBLE_UNREQUIRED_WORKSPACES: ${{ needs.check.outputs.incompatible-unrequired-workspaces }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}

permissions:
contents: write
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![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)
[![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)

[![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)

Expand Down