Skip to content

Commit 7815475

Browse files
committed
fix: update discussion info for release reusable workflow
- [x] use env vars - [x] update docs FAQ and link to the github action's readme that has a better (more accurate) GraphQL query to get the repository-id and category-id Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent 8e8cf89 commit 7815475

File tree

2 files changed

+4
-36
lines changed

2 files changed

+4
-36
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ jobs:
152152
with:
153153
title: ${{ needs.create_release.outputs.full-tag }}
154154
body: ${{ needs.create_release.outputs.body }}
155-
repository-id: ${{ secrets.discussion-repository-id }}
156-
category-id: ${{ secrets.discussion-category-id }}
155+
repository-id: ${{ env.DISCUSSION_REPOSITORY_ID }}
156+
category-id: ${{ env.DISCUSSION_CATEGORY_ID }}

docs/faq.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,5 @@
11
# Frequently Asked Questions
22

3-
## How to I get the repository ID to put in my Actions secrets for use with the reusable release workflow?
3+
## How do I get the repository-id and category-id for the release reusable workflow's discussion part
44

5-
You can get a repository's ID via the GitHub Rest API endpoint](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository). I found using the `gh` CLI tool to be the easiest way to get the repository ID. You can use the following command to get the repository ID:
6-
7-
change the `OWNER` and `REPO` to the repository you are interested in.
8-
9-
```bash
10-
# GitHub CLI api
11-
# https://cli.github.com/manual/gh_api
12-
13-
gh api \
14-
-H "Accept: application/vnd.github+json" \
15-
-H "X-GitHub-Api-Version: 2022-11-28" \
16-
/repos/OWNER/REPO
17-
```
18-
19-
## How do I get the discussion category ID to put in my Actions secrets for use with the reusable release workflow?
20-
21-
You can get a repository's discussion category ID via the GitHub GraphQL API. You can use the [GraphQL Explorer UI Tool](https://docs.github.com/en/graphql/overview/explorer) to get the discussion category ID. You can use the following query to get the discussion category ID:
22-
23-
change the `owner` and `name` to the repository you are interested in.
24-
25-
```graphql
26-
query {
27-
repository(owner: "jmeridth", name: "reusable-workflows") {
28-
discussionCategories(first: 10) {
29-
nodes {
30-
# type: DiscussionCategory
31-
id
32-
name
33-
}
34-
}
35-
}
36-
}
37-
```
5+
The workflow I use to generate the discussion has this information in its [README](https://github.com/abirismyname/create-discussion/tree/6e6ef67e5eeb042343ef8b3d8d0f5d545cbdf024/?tab=readme-ov-file#obtaining-the-repository-id-and-category-id)

0 commit comments

Comments
 (0)