Skip to content

Add issues to the Docs project #582

Add issues to the Docs project

Add issues to the Docs project #582

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:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: grafana/shared-workflows/actions/get-vault-secrets@main
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@v1
id: app-token
with:
app-id: ${{ env.ISSUE_COMMANDS_APP_ID }}
owner: grafana
private-key: ${{ env.ISSUE_COMMANDS_PRIVATE_KEY }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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@main
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@main
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 }}"
}
}
]
}