* update @umbraco-ui/uui to 1.3.0 * update ace editor to 1.22.1 * update diff to 5.1.0 * update autoprefixer to 10.4.14 * update underscore to 1.13.6 * update jQuery to 3.7.0 * fix pr-first-response workflow
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
name: pr-first-response
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
send-response:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Fetch random comment 🗣️ and add it to the PR
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
|
|
method: 'post',
|
|
body: JSON.stringify({
|
|
repo: '${{ github.repository }}',
|
|
number: '${{ github.event.number }}',
|
|
actor: '${{ github.actor }}',
|
|
commentType: 'opened-pr-first-comment'
|
|
}),
|
|
headers: {
|
|
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
|
|
try {
|
|
const data = await response.text();
|
|
|
|
if(response.status === 200 && data !== '') {
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: data
|
|
});
|
|
} else {
|
|
console.log("Returned data not indicate success.");
|
|
|
|
if(response.status !== 200) {
|
|
console.log("Status code:", response.status)
|
|
}
|
|
|
|
console.log("Returned data:", data);
|
|
|
|
if(data === '') {
|
|
console.log("An empty response usually indicates that either no comment was found or the actor user was not eligible for getting an automated response (HQ users are not getting auto-responses).")
|
|
}
|
|
}
|
|
} catch(error) {
|
|
console.log(error);
|
|
}
|