Skip to content

Commit

Permalink
Use centralized "Add to docs project" action (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbaldry authored Sep 16, 2024
1 parent be73ec9 commit 700fe86
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 49 deletions.
10 changes: 0 additions & 10 deletions .github/issue_and_pr_commands.json

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/add-to-docs-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add to docs project
on:
issues:
types: [labeled]
pull_request:
types: [labeled]
jobs:
main:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.label.name == 'type/docs' }}
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./add-to-docs-project
37 changes: 0 additions & 37 deletions .github/workflows/issue_and_pr_commands.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: grafana/writers-toolkit/prettier@prettier/v1
- uses: ./prettier
with:
branch: ${{ env.GITHUB_REF }}
trace: ${{ inputs.trace }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-technical-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: grafana/writers-toolkit/publish-technical-documentation@main
- uses: ./publish-technical-documentation
with:
website_directory: content/docs/writers-toolkit
36 changes: 36 additions & 0 deletions add-to-docs-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Add to docs project
description: |
This action adds issues to the [Docs team (Grafana Labs wide)](https://github.com/orgs/grafana/projects/69) project.
You need the following permissions on the workflow to fetch secrets from Vault needed by this action.
```yaml
permissions:
contents: read
id-token: write
```
You should restrict the workflow runs with:
```yaml
github.event.pull_request.head.repo.full_name == github.repository && github.event.label.name == 'type/docs'
```
runs:
using: composite
steps:
- id: get-secrets
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 }}
private-key: ${{ env.ISSUE_COMMANDS_PRIVATE_KEY }}
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/grafana/projects/69
github-token: ${{ steps.app-token.outputs.token }}
labeled: type/docs

0 comments on commit 700fe86

Please sign in to comment.