diff --git a/.github/workflows/broken-linkcheck.yml b/.github/workflows/broken-linkcheck.yml index 10ab5b08a4437..5b9abec1137dc 100644 --- a/.github/workflows/broken-linkcheck.yml +++ b/.github/workflows/broken-linkcheck.yml @@ -26,13 +26,40 @@ jobs: - name: Build Pandas uses: ./.github/actions/build_pandas + - name: Set current date as environment variable + run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Run linkcheck script working-directory: ./doc run: | set -o pipefail python make.py linkcheck | tee linkcheck.txt + - name: Create or Update Linkcheck Issue + if: failure() && github.event_name == 'schedule' + uses: dacbd/create-issue-action@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + current_date: $(date +"%Y-%m-%d") + title: "Linkcheck Report - ${{ env.CURRENT_DATE }}" + labels: "Docs,Good First Issue,Linkcheck-Report" + body: | + ### Linkcheck Report + + This issue is automatically created or updated to report broken links found during the linkcheck process. + + #### Summary: + + - Number of Broken Links: X + - Date: ${{ env.CURRENT_DATE }} + + #### Broken Links: + + ``` + $(cat linkcheck.txt) + ``` + - name: Display broken links - if: failure() + if: failure() && github.event_name == 'schedule' working-directory: ./doc run: grep broken linkcheck.txt