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

$RESOLVED_VERSION not expanded when set via action input #1048

Closed
mkurz opened this issue Feb 1, 2022 · 8 comments · Fixed by #1049
Closed

$RESOLVED_VERSION not expanded when set via action input #1048

mkurz opened this issue Feb 1, 2022 · 8 comments · Fixed by #1049

Comments

@mkurz
Copy link
Contributor

mkurz commented Feb 1, 2022

Using the name input:

...
jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    steps:
      - uses: release-drafter/release-drafter@v5
        with:
          name: "$RESOLVED_VERSION"
...

the release draft will be named $RESOLVED_VERSION, which obviously is not what I expected.

However inside the config file

name-template: '$RESOLVED_VERSION'

the release draft will correctly be named with the version, e.g. 1.0.0.

Now, the name overrides the name-template:

I expect both configs behave identically, I would have guessed variable expansion takes places after the override happened, so it shouldn't matter where the config string came from.

@jetersen
Copy link
Member

jetersen commented Feb 1, 2022

Maybe but what's wrong with using name-template?

@mkurz
Copy link
Contributor Author

mkurz commented Feb 1, 2022

Nothing wrong with using name-template, however I am setting up a generic release draft in our org's .github repo and in various other repos I set up workflows that reference that base.yml draft, and want to use the specific project name as title of the release.
For example:
repoA has the workflow:

...
        with:
          name: "Project A $RESOLVED_VERSION"
...

repoB has the workflow

...
        with:
          name: "Project B $RESOLVED_VERSION"
...

BTW: I tried to achieve that with env variables, by passing the project name to the base file, but that doesn't working (#847). Actually for our needs using $RESOLVED_VERSION would be enough.

@jetersen
Copy link
Member

jetersen commented Feb 1, 2022

Right make sense, would welcome a PR :)

@mkurz
Copy link
Contributor Author

mkurz commented Feb 1, 2022

Sure, I hope I find time.

@jetersen
Copy link
Member

jetersen commented Feb 1, 2022

You should have access to $REPO and $OWNER maybe I made a mistake and did not allow it to be expanded in name-template and tag-template most likely for tag-template it should lowercase or simply not be possible?

@mkurz mkurz closed this as completed Feb 1, 2022
@mkurz mkurz reopened this Feb 1, 2022
@mkurz
Copy link
Contributor Author

mkurz commented Feb 1, 2022

(Closed by accident)

I just tried again, $RESOLVED_VERSION does work when used in name-template.
It does not work when name-template gets overriden by the name input:

That's what I see in https://github.com/playframework/twirl/releases right now (name: "Twirl $RESOLVED_VERSION"):

That's what I saw a couple of minutes before adding the name input, so there was only name-template: 'Version $RESOLVED_VERSION':

So we do have access to $RESOLVED_VERSION in name-template, but not when it is overriden with the name action input.

@jetersen
Copy link
Member

jetersen commented Feb 1, 2022

So we do have access to $RESOLVED_VERSION in name-template, but not when it is overriden with the name action input.

Exactly

@mkurz
Copy link
Contributor Author

mkurz commented Feb 1, 2022

@jetersen Here is the fix #1049, wasn't too hard.

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

Successfully merging a pull request may close this issue.

2 participants