Skip to content

Call composite actions with dynamic names in a workflow #63675

Closed Answered by soumyamahunt
Prudvi-data asked this question in Actions
Discussion options

You must be logged in to vote

uses expects the action name to be determined before running the action, so while running the action you can't specify dynamic action for uses. You have to wrap your dynamic invocation inside a composite action and invoke the composite action path from your job. That way you can adjust the content of the composite action just before the action is invoked. You can use something like this:

Test-Run:
    strategy:
      matrix:
        repo: ${{ REPOS_LIST }}
    runs-on: ubuntu-latest
    container:
      image: image_name
      env:
        DYNAMIC_ACTION: ./.dynamic-action
        LANG: en_US.utf8
    steps:
      - name: Setup  config
        run:  some steps

      - name: prepare compo…

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@nirav-gajera
Comment options

@Prudvi-data
Comment options

@nirav-gajera
Comment options

@Prudvi-data
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Prudvi-data
Comment options

You must be logged in to vote
1 reply
@yan-bcw
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
5 participants