release-drafter: Complains about missing template

I tried v5 and v5.11.0.

on develop (with develop as default branch)

name: Release Drafter

on:
  push:
    branches:
      - develop

jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Draft Release
        uses: release-drafter/release-drafter@v5.11.0
        with:
          config-name: .github/release-drafter.yml
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image

image

(And I have tried the same on master branch as well.)

release-drafter.yml

name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
  - title: "✨ Features"
    labels:
      - "feature"
      - "enhancement"
  - title: "šŸ› Bug Fixes"
    label: "fix"
  - title: "šŸ“š Documentation"
    label: "docs"
  - title: "āœ… Tests"
    label: "docs"
  - title: "🧰 Maintenance"
    labels:
      - "chore"
      - "ci"
      - "refactor"
      - "build"
      - "revert"

change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
template: |
  ## Changes

  $CHANGES

These are some of the other configs I tried but I get the same error everytime.

without custom config

name: Release Drafter

on:
  push:
    branches:
      - develop

jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    steps:
      - name: Draft Release
        uses: release-drafter/release-drafter@v5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on master (master default branch)

name: Release Drafter

on:
  push:
    branches:
      - master

jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    steps:
      - name: Draft Release
        uses: release-drafter/release-drafter@v5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

The behavior of only looking for config files in the default branch is a bit confusing when trying to introduce this action via a new pull request, since the new functionality can’t actually be tested.

For anyone trying to get this working on a feature branch: AFAIK there is no way to do so; this action only works when the config file exists under .github in the default branch.

@BatmanAoD This is odd behavior and to me doesn’t pass the ā€œWTF testā€. I wouldn’t expect a config file to be pulled from another branch for the reason you describe OR for modifying the template via pull request and testing it out before merging…

@tapsboy Inside your .github repo it should be under the path .github/release-drafter.yml

Nowadays you don’t even need a .github/release-drafter.yml with _extends: .github it should pick it up by default.

Basically it should allow you to use release-drafter without having to plaster a config file in every repo when using .github repo with a file inside .github/release-drafter.yml

I’ve run into the same problem but in my case I’ve got a (private but that’s unimportant) repository with main as the default branch. However, release-drafter seems to look for the config on the branch called master.

Since it becomes rather common for projects to make the switch to main and even GitHub has it on their roadmap to make it their default for new repos going forward, it only makes sense to support config files that are located on other branches!

In the code it seems that the config is being loaded here but I was unable to trace where context comes from or what it does when calling the context.config function.

I met the same problem. Hope you have solution soon!