devcontainers / devcontainers/action

desire to have a way to list relevant (changed) features

Open
#197 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
32
PR merge metrics
No merged PRs in 30d

Description

idk if this is the right spot to bring this up but hey 🤷‍♀️

I've recently found immense usefulness in being able to list which features changed and default to all of them if the changes cant be determined https://github.com/devcontainers-community/list-features (no its not very polished yet)

i notice that there seems to be an attempt to do this in the feature-starter repo:

```yml
strategy:
matrix:
features: # 👈
- color
- hello
baseImage:
- debian:latest
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:ubuntu
```

I think it's very nice to be able to do this instead:

```yml
list-features:
outputs:
relevant-features: ${{ steps.list-features.outputs.relevant-features }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: list-features
uses: devcontainers-community/list-features@v2

strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.list-features.outputs.relevant-features) }}

# then do this
${{ matrix.id }} ${{ matrix.documentationURL }}
```
or this if you prefer to matrix your image too (disclaimer haven't tested this flow yet)
```yml
strategy:
fail-fast: false
matrix:
feature: ${{ fromJSON(needs.list-features.outputs.relevant-features) }}
image:
- debian:latest
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:ubuntu

# then do this
${{ matrix.feature.id }} ${{ matrix.image }} ${{ matrix.feature.documentationURL }}
```

used in a repo like this
https://github.com/devcontainers-community/npm-features/blob/main/.github/workflows/test-features.yml

demo of it in action
https://github.com/devcontainers-community/npm-features
ex: ![image](https://github.com/devcontainers/action/assets/61068799/bc2d7852-f62d-431f-ad4e-e68b3fe80f2e)

id to see this thing into the official @devcontainers feaeture-starter or organization if that's possible. idk if this is completely breaking some kind of unspoken project ettiqute; i just want this thing to be "official" since it seems so cool.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.