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

Support Excluding through expression #414

Closed
acouch opened this issue Apr 19, 2024 · 1 comment
Closed

Support Excluding through expression #414

acouch opened this issue Apr 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@acouch
Copy link

acouch commented Apr 19, 2024

Running into an issue where I'd like to excldue a matrix entry via an expression, but it flags that the return value isn't one of the matrix combos:

value "${{ (github.event_name == 'release' && 'prod') || 'dev' }}" in "exclude" does not match in matrix "envs" combinations. possible values are "dev", "staging", "prod"

image

Here is an example file:

name: Test Matrix

run-name: Deploy ${{ github.ref_name }} 

on: [push]

jobs:
  deploy-infra:
    name: Deploy Infrastructure
    runs-on: ubuntu-latest
    strategy:
      matrix:
        directory: ["database", "service"]
        envs: ['dev', 'staging', 'prod']
        exclude:
          - envs: ${{ (github.event_name == 'release' && 'prod') || 'dev' }}
    steps:
      - name: Show matrix
        run: |
          echo ${{ matrix.directory }} ${{ matrix.envs }}

Any assistance or pointers appreciated.

@rhysd rhysd added the bug Something isn't working label Apr 20, 2024
@rhysd
Copy link
Owner

rhysd commented Apr 20, 2024

Thank you for reporting this. This is a bug that actionlint does not recognize expressions in strategy.matrix.exclude.

@rhysd rhysd closed this as completed in ba825a9 Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants