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

includes-script in included actions #13

Closed
drdanz opened this issue Mar 12, 2021 · 3 comments
Closed

includes-script in included actions #13

drdanz opened this issue Mar 12, 2021 · 3 comments

Comments

@drdanz
Copy link

drdanz commented Mar 12, 2021

It would be nice to be able to use includes-script in actions included with includes.

For example:

.github/workflows-src/workflow.yml

jobs:
  job1:
    steps:
    - includes: /an_action

.github/actions/an_action/action.yml (or maybe .github/actions-src/an_action/action.yml)

runs:
  using: "includes"
  steps:
    - name: An action
      includes-script: script.py

.github/actions/an_action/script.py (or maybe .github/actions-src/an_action/script.py)

    print('Hello world')

would result in this workflow:

.github/workflows-src/workflow.yml

jobs:
  job1:
    steps:
    - name: An action
      shell: python
      run: |
         print('Hello world')
@mithro
Copy link
Owner

mithro commented Mar 12, 2021

I believe this should already work?

@mithro
Copy link
Owner

mithro commented Mar 12, 2021

test-includes-script:
needs: docker-image-build
runs-on: ubuntu-20.04
steps:
- includes: ./tests/include-script

name: include-script
description: "Basic includable action which uses includes-script."
runs:
using: "includes"
steps:
- name: Included Python Script
includes-script: script.py

@drdanz
Copy link
Author

drdanz commented Mar 12, 2021

You are right, sorry, the problem was that the file was in the workflow folder and not in the action folder, and the execution did not report any error (the error was actually in the generated file, but I didn't notice that).

@drdanz drdanz closed this as completed Mar 12, 2021
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