-
Notifications
You must be signed in to change notification settings - Fork 22
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
Multi-spec repositories, Echidna tokens and build overrides #55
Comments
I think my attempt to keep the example short might have made it a bit misleading. Following is a more complete example: name: CI
on:
pull_request: {}
push:
branches: [main]
jobs:
main:
name: Build, Validate and Deploy
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- source: spec.html
destination: index.html
echidna-token: ${{ secrets.ECHIDNA_TOKEN }}
- source: spec-1
destination: the-spec
echidna-token: ${{ secrets.ECHIDNA_TOKEN_SPEC_1 }}
- source: spec-2
# destination defaults to spec-2/index.html
echidna-token: ${{ secrets.ECHIDNA_TOKEN_SPEC_2 }}
steps:
- uses: actions/checkout@v2
- uses: w3c/spec-prod@v2
with:
SOURCE: ${{ matrix.source }}
DESTINATION: ${{ matrix.destination }}
GH_PAGES_BRANCH: gh-pages
W3C_ECHIDNA_TOKEN: ${{ matrix.echidna-token }}
W3C_WG_DECISION_URL: "https://lists.w3.org/Archives/Public/xyz.html"
IIRC, GitHub Actions also support an "or" operation, so we can have defaults like:
I think that would depend on how many specs there are, and how many custom options the workflow needs. Both are right ways to do things, and are supported by the action. Primary concern with separate workflows is maintenance (like updating version in |
Ah, got it, I wasn't familiar with this I don't really know which of these approaches will work better. I wouldn't be surprised if different groups choose different approaches ;) |
I'm reopening this issue because I'm running into problems with secrets at the The action fails to run with: "The workflow is not valid. .github/workflows/pr-push.yml (Line: 26, Col: 28): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.ECHIDNA_TOKEN_WEBCODECS". The secrets do exist and the error seems to be with the |
The As suggested in that thread, a workaround that seems to work is to list the secret name at the matrix level and to dereference the name in the actual step with @sidvishnoi let me know if you see a better way to do that. It would probably be a good idea to document the pattern in the examples page otherwise :) |
The `secrets` context is not available at the `matrix` level. See discussion in: w3c/spec-prod#55 (comment) Workaround is to list the secret name at that level and to dereference it in the actual step.
@tidoust Thanks for figuring this out. I think this is the best way, if it works. I'll keep this issue open until I get time to document it. |
Resolved in #77 |
I haven't tried it yet but I'm surprised that multi-spec repositories support actually works as documented. Aren't Echidna tokens per spec? Cc @deniak
Also,
GH_PAGES_BUILD_OVERRIDE
andW3C_BUILD_OVERRIDE
are typically settings that one would want to set on individual specs, and the use of a source/destination matrix for multi-spec repositories does not seem to allow that. For instance, a repo could contain a spec that needs to be published as WD and a spec that needs to be published as CRD.All of the above can be solved by using the workaround that separates worfklows. I'm wondering whether that could be the right way to do it in practice (a tad verbose perhaps), and not only a workaround...
The text was updated successfully, but these errors were encountered: