forked from MicrosoftDocs/executable-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 965 Bytes
/
issue.yml
File metadata and controls
33 lines (29 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Check Sync Failure and Create Issue
on:
workflow_run:
workflows: ["sync"]
types:
- completed
jobs:
create_issue:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read metadata
id: metadata
run: |
CONTENT=$(jq -r '.[0] | "\(.title)\n\(.description)"' metadata.json)
echo "::set-output name=content::$CONTENT"
- name: Create Issue
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = {
owner: 'MicrosoftDocs',
repo: 'azure-docs-pr',
title: 'An issue from a GitHub Action',
body: `The [sync workflow](https://github.com/MicrosoftDocs/executable-docs/actions/workflows/sync.yml) failed.\n\n${{ steps.metadata.outputs.content }}`
}
github.rest.issues.create(issue)