TO-291: Add notifications model #1634
This file contains hidden or 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
| # Copyright 2025 Canonical Ltd. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| # SPDX-FileCopyrightText: Copyright 2025 Canonical Ltd. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Check for removed URLs | |
| on: | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| build-docs: | |
| name: Build Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| # This implicitly gets the PR branch. Making it explicit causes problems | |
| # with private forks, but it is equivalent to the following: | |
| # repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| # ref: ${{ github.event.pull_request.head.ref }} | |
| fetch-depth: 0 | |
| path: compare | |
| persist-credentials: false | |
| - name: Checkout base branch | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| repository: ${{ github.event.pull_request.base.repo.full_name }} | |
| fetch-depth: 0 | |
| path: base | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| - name: Build docs | |
| run: | | |
| for dir in compare base; do | |
| pushd ${dir}/docs | |
| make install | |
| . .sphinx/venv/bin/activate | |
| make html | |
| popd | |
| done | |
| - name: Generate current URLs list | |
| run: | | |
| for dir in compare base; do | |
| pushd ${dir}/docs | |
| find ./_build/ -name '*.html' \ | |
| | sed 's|/_build||;s|/index.html$|/|;s|.html$||' \ | |
| | sort > urls.txt | |
| popd | |
| done | |
| - name: Compare URLs | |
| run: | | |
| BASE_URLS_PATH="base/docs/urls.txt" | |
| COMPARE_URLS_PATH="compare/docs/urls.txt" | |
| removed=$(comm -23 ${BASE_URLS_PATH} ${COMPARE_URLS_PATH} ) | |
| if [ -n "$removed" ]; then | |
| echo "The following URLs were removed:" | |
| echo "$removed" | |
| echo "Please ensure removed pages are redirected" | |
| exit 1 | |
| fi |