-
Notifications
You must be signed in to change notification settings - Fork 13
84 lines (76 loc) · 2.97 KB
/
add-to-docs-project.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Add issues to the Docs project
on:
schedule:
# At every 30th minute past every hour from 6 through 18 on every day-of-week from Monday through Friday.
- cron: "*/30 6-18 * * 1-5"
workflow_dispatch:
jobs:
main:
if: ${{ github.repository == 'grafana/writers-toolkit' }}
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: grafana/shared-workflows/actions/get-vault-secrets@97c6f45f01d4bca8a3b1acfe397113ce88858a81 # get-vault-secrets-v1.0.1
with:
common_secrets: |
ISSUE_COMMANDS_APP_ID=docs-team/issue-commands:app-id
ISSUE_COMMANDS_PRIVATE_KEY=docs-team/issue-commands:key
- uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
id: app-token
with:
app-id: ${{ env.ISSUE_COMMANDS_APP_ID }}
owner: grafana
private-key: ${{ env.ISSUE_COMMANDS_PRIVATE_KEY }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: npm
node-version-file: "add-to-docs-project/package.json"
- run: npm ci
working-directory: ./add-to-docs-project
- id: add-to-docs-project
run: npm run execute
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
working-directory: ./add-to-docs-project
- name: Send Slack Message
id: slack
if: ${{ steps.add-to-docs-project.outputs.added != ''}}
uses: grafana/shared-workflows/actions/send-slack-message@7b628e7352c2dea057c565cc4fcd5564d5f396c0 # v1.0.0
with:
channel-id: C05V6A36MB7
payload: |
{
"text": "Added issues to the Docs project",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Added the following issues to the Docs project:\n${{ steps.add-to-docs-project.outputs.added }}"
}
}
]
}
- name: Notify failure
if: failure()
uses: grafana/shared-workflows/actions/send-slack-message@7b628e7352c2dea057c565cc4fcd5564d5f396c0 # v1.0.0
with:
channel-id: C05V6A36MB7
payload: |
{
"text": "Failed to add issues to the Docs project in run ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Failed to add issues to the Docs project in run ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}