release-drafter / release-drafter

Drafts your next release notes as pull requests are merged into master.
https://github.com/marketplace/actions/release-drafter
ISC License
3.35k stars 326 forks source link

Error: Invalid config file when trying to fetch the config file from a private <ORGANIZATION>/.github repository (special repository) #1328

Closed AllanOricil closed 1 year ago

AllanOricil commented 1 year ago

I'm using release-drafter@v5.23.0

This is where I've placed my release-drafter.yml config file in the <ORGANIZATION>/.github special repository

<ORGANIZATION>/.github
└── .github
    ├── workflows
    └── release-drafter.yml

This is my reusable workflow, which is at <ORGANIZATION>/github-reusable-workflows

name: Release Drafter Workflow

on:
  workflow_call:
    secrets:
      GH_TOKEN:
        required: false

permissions:
  contents: write
  pull-requests: write

jobs:
  release-drafter:
    runs-on: ubuntu-latest

    steps:
      - uses: release-drafter/release-drafter@v5.23.0
        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
        with:
          commitish: main

This is my caller workflow, which is called from <ORGANIZATION>/my-repo. I'm passing a custom Github PAT that grants access to any private repository that is within the same Organization

name: Release Drafter Workflow

on:
  push:
    branches:
      - main

  pull_request:
    types: [opened, reopened, synchronize]

permissions:
  contents: write
  pull-requests: write

jobs:
  release-drafter:
    uses: <ORGANIZATION>/github-reusable-workflows/.github/workflows/release-drafter.yml@main
    secrets:
      GH_TOKEN: ${{ secrets.GH_TOKEN }}

This is the release-drafter.yml config file that I added to <ORGANIZATION>/my-repo/.github:

_extends: .github

I also tried this one:

_extends: .github:.github/release-drafter.yml

None of them worked. I'm always getting the same output shown below

image image image image

AllanOricil commented 1 year ago

found the problem. The global release-drafter.yml must be in the default branch in the <ORGANIZATION>/.github repository. It makes sense, since we can't specify the branch when using _extends