Add issues to the Docs project #3575
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Add issues to the Docs project | |
| permissions: {} | |
| on: | |
| schedule: | |
| # Runs at 07:03, Monday through Friday. | |
| - cron: "3 7 * * 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@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| id: app-token | |
| with: | |
| app-id: ${{ env.ISSUE_COMMANDS_APP_ID }} | |
| owner: grafana | |
| private-key: ${{ env.ISSUE_COMMANDS_PRIVATE_KEY }} | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.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 }}" | |
| } | |
| } | |
| ] | |
| } |