Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add check links #3499

Closed
wants to merge 2 commits into from
Closed
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
57 changes: 31 additions & 26 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ jobs:
const docsChanged = files.some(file => file.filename.startsWith('docs/'));
return docsChanged;

- name: Add label if not present
if: steps.check-labels.outputs.result == 'true'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (!labels.includes('documentation')) {
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['documentation']
})
}
# - name: Add label if not present
# if: steps.check-labels.outputs.result == 'true'
# uses: actions/github-script@v3
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const labels = context.payload.pull_request.labels.map(label => label.name);
# if (!labels.includes('documentation')) {
# github.issues.addLabels({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: context.issue.number,
# labels: ['documentation']
# })
# }

build_and_deploy_preview:
runs-on: ubuntu-latest
permissions:
pull-requests: write
needs: add_label
if: needs.add_label.outputs.has_label == 'true'
# if: needs.add_label.outputs.has_label == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -100,14 +100,19 @@ jobs:
run:
yarn workspace docs build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.1
- name: Check links
uses: untitaker/hyperlink@0.1.31
with:
publish-dir: './docs/build'
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-github-deployment: false
deploy-message: "Deploy from GitHub Actions for PR ${{ github.event.number }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
args: './docs/build'

# - name: Deploy to Netlify
# uses: nwtgck/actions-netlify@v2.1
# with:
# publish-dir: './docs/build'
# github-token: ${{ secrets.GITHUB_TOKEN }}
# enable-github-deployment: false
# deploy-message: "Deploy from GitHub Actions for PR ${{ github.event.number }}"
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# timeout-minutes: 1
Loading