Skip to content

fix(autofix.ci): apply automated fixes #792

fix(autofix.ci): apply automated fixes

fix(autofix.ci): apply automated fixes #792

Workflow file for this run

name: 🪄 Deploy Preview
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request_target:
permissions:
pull-requests: write
jobs:
preview-comment:
runs-on: ubuntu-latest
steps:
- name: 🪄 Add a comment
uses: actions/github-script@v9
with:
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const previewComment = comments.find(comment => {
return comment.user.type === 'Bot' && comment.body.includes('# 🪄 Deploy Preview for ready!')
})
const body = `# 🪄 Deploy Preview for ready!
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/${{ github.repository }}/pull/${{ github.event.pull_request.number }})
*Learn more about [StackBlitz Codeflow](https://stackblitz.com/codeflow/).*
<!-- generated-comment [Preview](https://github.com/${{ github.repository }}/.github/workflows/preview.yml) -->`
if (!previewComment) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
})
}