From d8559fef1d22f48ce367ac35e3ce27b2266087a4 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Mon, 24 May 2021 16:21:47 -0700 Subject: [PATCH] GHA: allow style checker fail; post link to preview --- .github/workflows/link-checker-pr.yml | 20 ++++---- .github/workflows/pr-preview.yaml | 66 --------------------------- 2 files changed, 12 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/pr-preview.yaml diff --git a/.github/workflows/link-checker-pr.yml b/.github/workflows/link-checker-pr.yml index 886c308ea5..84f8f7c84d 100644 --- a/.github/workflows/link-checker-pr.yml +++ b/.github/workflows/link-checker-pr.yml @@ -44,14 +44,6 @@ jobs: echo 'EOF' >> $GITHUB_ENV cat linkreport.txt - - name: Comment Broken Links - uses: unsplash/comment-on-pr@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - msg: ${{ env.LINKREPORT }} - check_for_duplicate_msg: false - - name: Deploy preview to gh-pages uses: sauloxd/review-apps@v1.3.3 with: @@ -60,5 +52,17 @@ jobs: dist: "out" slug: "pr-preview" + - name: Get short SHA6 + id: slug + run: echo "::set-output name=sha6::$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-6)" + - name: Run Style Checker + continue-on-error: true run: dactyl_style_checker -q + + - name: Summarize Output + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: ${{ env.LINKREPORT }}\n\nPreview: https://${{env.GITHUB_REPOSITORY_OWNER_SLUG}}.github.io/${{env.GITHUB_REPOSITORY_NAME}}/pr-preview/${{steps.branchname.outputs.branch}}/${{steps.slug.outputs.sha6}} diff --git a/.github/workflows/pr-preview.yaml b/.github/workflows/pr-preview.yaml deleted file mode 100644 index 65a8ab1bde..0000000000 --- a/.github/workflows/pr-preview.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: "Preview PR builds in the gh-pages branch" - -# Temporarily disabled: attempting to roll this into the link-checker-pr job -# on: -# pull_request: -# types: [opened, edited, synchronize] - -jobs: - build: - name: Build Dactyl Site - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Python Setup - uses: actions/setup-python@v1 - with: - python-version: "3.7" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install Jinja2==2.11.3 - pip install dactyl lxml - - name: PR Branch Name - uses: mdecoleman/pr-branch-name@1.0.0 - id: branchname - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: GitHub Environment Variables Action - uses: FranzDiebold/github-env-vars-action@v1.2.1 - - name: Get PR commit trigger SHA - uses: bhowell2/github-substring-action@v1.0.0 - id: prsha - with: - value: ${{ github.event.pull_request.head.sha }} - length_from_start: 6 - - name: Get short SHA6 - id: slug - env: - PRSHA: ${{ steps.prsha.outputs.substring }} - run: echo "::set-output name=sha6::$(echo ${PRSHA} | cut -c1-6)" - - name: Get PR commit trigger SHA - uses: bhowell2/github-substring-action@v1.0.0 - id: prsha7 - with: - value: ${{ github.event.pull_request.head.sha }} - length_from_start: 7 - - name: Get short SHA7 - id: slug7 - env: - PRSHA: ${{ steps.prsha7.outputs.substring }} - run: echo "::set-output name=sha7::$(echo ${PRSHA} | cut -c1-7)" - - name: Build and deploy to gh-pages - uses: sauloxd/review-apps@v1.3.3 - with: - build-cmd: "dactyl_build" - branch: "gh-pages" - dist: "out" - slug: "review-apps" - - name: Comment URL on PR - uses: unsplash/comment-on-pr@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SHA: ${{ github.event.pull_request.head.sha }} - with: - msg: "https://${{env.GITHUB_REPOSITORY_OWNER_SLUG}}.github.io/${{env.GITHUB_REPOSITORY_NAME}}/review-apps/${{steps.branchname.outputs.branch}}/${{steps.slug.outputs.sha6}}?version=${{steps.slug7.outputs.sha7}}" - check_for_duplicate_msg: false