Skip to content

(maint) Prevent workflow from failing on no-op #69488

(maint) Prevent workflow from failing on no-op

(maint) Prevent workflow from failing on no-op #69488

Workflow file for this run

name: Labeler
on: [pull_request]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Set documentation preview
if: github.event.pull_request.head.repo.fork == false
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.repos.createCommitStatus({
"owner": context.repo.owner,
"repo": context.repo.repo,
"sha": context.payload.pull_request.head.sha,
"state": "success",
"context": "preview",
"description": `Check preview branch "${context.payload.pull_request.head.ref}"`,
"target_url": `https://docs-staging.datadoghq.com/${context.payload.pull_request.head.ref}`
})