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

Can't use a dynamic release-as config after v4 migration #1068

Open
onderceylan opened this issue Dec 24, 2024 · 0 comments · May be fixed by #1069
Open

Can't use a dynamic release-as config after v4 migration #1068

onderceylan opened this issue Dec 24, 2024 · 0 comments · May be fixed by #1069
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@onderceylan
Copy link

We have a use case of creating a hotfix release with a self calculated patch version, of which we need to pass to the action as the release-as config variable. This config variable is calculated dynamically and is not committed to the repository.

v4 version requires users to use a config file to set the release-as config. And, config files cannot be read from the filesystem, and has to be committed to the repo and be fetched from a repo & branch ref. As for the hotfix use case, this config is a dynamic variable, and can't be committed to the repo. Therefore, we can't use a dynamic release-as config after v4 migration.

On a side note, if release-please upstream package would have supported loading config files from a local filesystem, we would not have this issue. It's reported separately on #1017.

Environment details

  • Programming language: Node.js / TypeScript
  • OS: ubuntu-22.04
  • Language runtime version: Node.js 22.11.0
  • Package version: v4.1.3

Steps to reproduce

  1. Have a config file that will be used for hotfix releases - release-please-config.hotfix.json
{
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
  "release-type": "simple",
  "pull-request-title-pattern": "chore(release): hotfix release ${version}",
  "pull-request-header": "🚨 Hotfix Release",
  "label": "hotfix",
  "release-label": "hotfix",
  "packages": {
    ".": {}
  }
}
  1. Have a step in the workflow to dynamically update the config file
- name: Update hotfix config version
  run: |
    jq --arg version "${{ steps.hotfix-version.outputs.new_version }}" \
      '. + {"release-as": $version}' \
      release-please-config.hotfix.json > temp.json && mv temp.json release-please-config.hotfix.json

    echo "Updated hotfix config:"
    cat release-please-config.hotfix.json
  1. Run the workflow with the hotfix config file
- uses: googleapis/release-please-action@v4
  id: release
  with:
    config-file: release-please-config.hotfix.json
    manifest-file: .release-please-manifest.json
    target-branch: ${{ inputs.hotfix-branch }}
    token: ${{ steps.generate-token.outputs.token }}
@onderceylan onderceylan added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 24, 2024
@onderceylan onderceylan linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant