Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Multiple drafts same repository #1351

Open
ranrsg opened this issue Aug 2, 2023 · 1 comment
Open

[Question] Multiple drafts same repository #1351

ranrsg opened this issue Aug 2, 2023 · 1 comment

Comments

@ranrsg
Copy link

ranrsg commented Aug 2, 2023

I'm using the release-drafter to generate draft releases for two projects I have in the same repository.
We got to a point where we overwrite each other drafts and I would like to have a dedicated draft for each project.

As far as I understood the config-name input should help me here - but I could not figure out how to make it work.

My current setup:

  • A dedicated release-drafter config file for each project inside the .github directory
  • A dedicated Github workflow file for each project
  1. Project X
  • release-drafter config (.github/release-drafter-x.yml)
template: |
  ## Project X - What’s Changed

  $CHANGES
  • Workflow (.github/workflows/project-x.yml)
name: Project X RELEASE
on:
    push:
      tags:
        - 'Project_X_Release*'

jobs: 
  project-x: 
    runs-on: ubuntu-latest
    steps: 
    - uses: release-drafter/release-drafter@v5.21.1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        config-name: release-drafter-x.yml
        tag: ${{ github.ref_name }}
        name: "Project X Release"
        version: "<sample>"
  1. Project Y
  • release-drafter config (.github/release-drafter-y.yml)
template: |
  ## Project Y - What’s Changed

  $CHANGES
  • Workflow (.github/workflows/project-y.yml)
name: Project Y RELEASE
on:
    push:
      tags:
        - 'Project_Y_Release*'

jobs: 
  project-y: 
    runs-on: ubuntu-latest
    steps: 
    - uses: release-drafter/release-drafter@v5.21.1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        config-name: release-drafter-y.yml
        tag: ${{ github.ref_name }}
        name: "Project Y Release"
        version: "<sample>"

I expected to have separate release drafts for each project with this setup - but it seems like the drafts are getting overwritten by each other.
Is it possible to generate separate draft releases for different project on same repo? if so, where am I wrong in my setup?

@denvifer
Copy link

You can use tag-prefix for this.

Just add to your drafter configs:

tag-prefix: "project_x/"
tag-prefix: "project_y/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants