diff --git a/.github/labeler.yaml b/.github/labeler.yml similarity index 100% rename from .github/labeler.yaml rename to .github/labeler.yml diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml index c65f211..87e8dea 100644 --- a/.github/workflows/labeler.yaml +++ b/.github/workflows/labeler.yaml @@ -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 @@ -17,4 +22,5 @@ jobs: - uses: actions/checkout@v4.2.2 - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5 with: + configuration-path: ${{ inputs.config-path }} repo-token: "${{ secrets.github-token }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index adb0111..f0b3407 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/.github/workflows/test-labeler.yaml b/.github/workflows/test-labeler.yaml index a17e7ab..85b3b7e 100644 --- a/.github/workflows/test-labeler.yaml +++ b/.github/workflows/test-labeler.yaml @@ -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 }} diff --git a/README.md b/README.md index ede2122..ec61f04 100644 --- a/README.md +++ b/README.md @@ -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] diff --git a/docs/faq.md b/docs/faq.md index 3acce15..fc48bf4 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -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)