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

Feature Request: support fetching release-please-config.json from the file system #1017

Open
zepeng811 opened this issue Jul 3, 2024 · 1 comment
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@zepeng811
Copy link

zepeng811 commented Jul 3, 2024

Is your feature request related to a problem? Please describe.
We are using shared workflow as an wrapper for the workflow for easy maintenance and upgrade. Back in v3 of the workflow, we can provide inputs with default values to the shared workflow, then the inputs can be modified per repository when necessary. Basically, we have a shared config with default settings and the option to modify during runtime:

- uses: googleapis/release-please-action@v3
   id: release
   with:
       default-branch: ${{ inputs.master_branch }}
       release-type: ${{ inputs.release_type }}
       package-name: ${{ github.event.repository.name }}
       include-v-in-tag: ${{ inputs.include_v_in_tag }}
       pull-request-title-pattern: ${{ inputs.pull_request_title_template }}
       path: ${{ inputs.path }}
       monorepo-tags: ${{ inputs.monorepo-tags }}

In v4, since all advanced configurations now require a config file, we are trying to dynamically generate the config file during runtime, with the above configurations roughly converted to:

     - name: Prepare release-please-config.json
        id: prepare-config
        run: |
          cat > release-please-config.json <<EOL
          {
            "\$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
            "release-type": "${{ inputs.release_type }}",
            "pull-request-title-pattern": "${{ inputs.pull_request_title_template) }}",
            "include-v-in-tag": ${{ inputs.include_v_in_tag }},
            "include-component-in-tag": ${{ inputs.monorepo-tags }},
            "packages": {
              "${{ inputs.path }}": {
                "package-name": "${{ github.event.repository.name }}"
              }
            }
          }
          EOL

      - uses: googleapis/release-please-action@v4
         id: release
         with:
           target-branch: ${{ inputs.master_branch }}
           config-file: release-please-config.json

However, this does not work for v4, because the action is always trying to fetch the release-please-config.json file from the source repository and branch. The file in the file system will get ignored.

Run googleapis/release-please-action@v4
Running release-please version: 16.12.0
❯ Fetching release-please-config.json from branch release-please
❯ Fetching .release-please-manifest.json from branch release-please

(GitHub Actions logs showing the action is trying to fetch the .json files from the git repository and branch)

Describe the solution you'd like
the config file can be fetched from the file system or the git source

Describe alternatives you've considered
The only alternative is to add release-please-config.json to each repository we use the action, this will cause duplicate code and make the configurations difficult to maintain.

@zepeng811 zepeng811 added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jul 3, 2024
@kellervater
Copy link

➕ 1️⃣ on this issue.
We have a similar use-case, where we want to avoid configuration duplication.
In our case we define additional "releasable units" in the config-file to also enable different prefixes than "fix" and "feat" to trigger releases. This is then the same for about 20 repository configs which we don't want to maintain separately if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants