microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
a6b7827fcd2db3bf604d42e235216c8d5b244f13

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/tryit-comment.yml

36lines · modecode

1# IMPORTANT: DO NOT CHECKOUT
2name: Make try it comment
3
4on:
5 pull_request_target:
6 types: [opened, reopened]
7
8concurrency: ${{ github.workflow }}-${{ github.ref }}
9
10# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11permissions:
12 pull-requests: write
13
14jobs:
15 # Create PR
16 pr_created:
17 name: Provide try it comments
18 runs-on: ubuntu-latest
19 steps:
20 - uses: actions/github-script@v5
21 with:
22 github-token: ${{secrets.GITHUB_TOKEN}}
23 script: |
24 const prNumber = ${{ github.event.pull_request.number }};
25 github.rest.issues.createComment({
26 issue_number: context.issue.number,
27 owner: context.repo.owner,
28 repo: context.repo.repo,
29 body: [
30 `Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status):`,
31 `Playground: https://cadlplayground.z22.web.core.windows.net/prs/${prNumber}/`,
32 "",
33 `Website: https://tspwebsitepr.z5.web.core.windows.net/prs/${prNumber}/`,
34
35 ].join("\n")
36 })
37