Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
6 changes: 6 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name: "Pull Request Labeler"
on:
workflow_call:
inputs:
config-path:
required: true
type: string
default: .github/labeler.yml
secrets:
github-token:
required: true
Expand All @@ -17,4 +22,5 @@ jobs:
- uses: actions/[email protected]
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5
with:
configuration-path: ${{ inputs.config-path }}
repo-token: "${{ secrets.github-token }}"
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ jobs:
with:
title: ${{ needs.create_release.outputs.full-tag }}
body: ${{ needs.create_release.outputs.body }}
repository-id: ${{ secrets.discussion-repository-id }}
category-id: ${{ secrets.discussion-category-id }}
repository-id: ${{ env.DISCUSSION_REPOSITORY_ID }}
category-id: ${{ env.DISCUSSION_CATEGORY_ID }}
2 changes: 2 additions & 0 deletions .github/workflows/test-labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ jobs:
contents: read
pull-requests: write
uses: ./.github/workflows/labeler.yaml
with:
config-path: .github/labeler.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a placeholder repo for multiple GitHub Actions I use in my personal and
> [!TIP]
> You can reuse the following files in this repository in your own as they are used by the reusable workflows:
>
> - [labeler.yaml](.github/labeler.yml)
> - [labeler.yml](.github/labeler.yml)
> - [release-drafter.yaml](.github/release-drafter.yml)

> [!WARNING]
Expand Down
36 changes: 2 additions & 34 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
# Frequently Asked Questions

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

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:

change the `OWNER` and `REPO` to the repository you are interested in.

```bash
# GitHub CLI api
# https://cli.github.com/manual/gh_api

gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/OWNER/REPO
```

## How do I get the discussion category ID to put in my Actions secrets for use with the reusable release workflow?

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:

change the `owner` and `name` to the repository you are interested in.

```graphql
query {
repository(owner: "jmeridth", name: "reusable-workflows") {
discussionCategories(first: 10) {
nodes {
# type: DiscussionCategory
id
name
}
}
}
}
```
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)
Loading