I have two steps in my github actions that only one of them executes based on an if condition
- name: step-stable
uses: some-action@some-version
if: ${{ env.BRANCH_NAME != 'stable' }}
with:
A=1
B=1
C=1
D=1
E=1
F=1
G=1
H=1
I=1
- name: step-other
uses: some-action@some-version
if: ${{ env.BRANCH_NAME == 'stable' }}
with:
A=2
B=2
C=1
D=1
E=1
F=1
G=1
H=1
I=1
This is a simplified version of my real problem.
As you see the below are the same in both cases.
D=1
E=1
F=1
G=1
H=1
I=1
I dont want to repeat them.
I am looking for a way to implement something similar to this to make it look nicer and easier to maintain
This is a pseudo-code and I am trying to communicate what I need
- name: simplified
uses: some-action@some-version
with:
A=1 if ${{ env.BRANCH_NAME != 'stable' }} else 2
B=1 if ${{ env.BRANCH_NAME != 'stable' }} else 2
C=1
D=1
E=1
F=1
G=1
H=1
I=1
How can I do this?