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

Add support for templating without the need for files #18

Open
allejo opened this issue Dec 19, 2023 · 0 comments
Open

Add support for templating without the need for files #18

allejo opened this issue Dec 19, 2023 · 0 comments

Comments

@allejo
Copy link

allejo commented Dec 19, 2023

I want to propose adding support for compiling templates without needing files. An example use case would be something along the lines of this,

- id: pr-message
  name: Create PR Message
  uses: cuchi/[email protected]
  with:
    template_str: |
      Hello! You've created a PR that has {{ num_files_touched }} files changed!

      {% for file in files %}
        - {{ file }}
      {% endfor %}
    strict: true
    variables: |
      files=...
      num_files_touched=30
- name: Create PR
  uses: peter-evans/create-pull-request@v5
  with:
    body: ${{ steps.pr-message.outputs.contents }}

Would this be feasible? A major version bump might be necessary since template and output_file will no longer be required. If output_file is omitted, it saves the contents to the step's outputs. Thoughts on the proposal?

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

1 participant