mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-18 16:56:35 +00:00
https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/71 requires partial implementation in runner, and partial in Forgejo; this is the Forgejo implementation. Allows for the definition of dynamic job matrixes in Forgejo Actions, where an earlier job provides and output that is used in `strategy.matrix` for a later job that requires it. For example, adapted from the GitHub Actions example for this feature: ```yaml name: shared matrix on: push: workflow_dispatch: jobs: define-matrix: runs-on: docker outputs: colors: ${{ steps.colors.outputs.colors }} steps: - name: Define Colors id: colors run: | echo 'colors=["red", "green", "blue"]' >> "$GITHUB_OUTPUT" produce-artifacts: runs-on: docker needs: define-matrix strategy: matrix: color: ${{ fromJSON(needs.define-matrix.outputs.colors) }} steps: - name: Define Color env: color: ${{ matrix.color }} run: | echo "$color" > color - name: Produce Artifact uses: https://data.forgejo.org/forgejo/upload-artifact@v4 with: name: ${{ matrix.color }} path: color consume-artifacts: runs-on: docker needs: - define-matrix - produce-artifacts strategy: matrix: color: ${{ fromJSON(needs.define-matrix.outputs.colors) }} steps: - name: Retrieve Artifact uses: https://data.forgejo.org/forgejo/download-artifact@v4 with: name: ${{ matrix.color }} - name: Report Color run: | cat color ``` ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [x] in their respective `*_test.go` for unit tests. - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [x] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - https://codeberg.org/forgejo/docs/pulls/1607 - [ ] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - Features - [PR](https://codeberg.org/forgejo/forgejo/pulls/10244): <!--number 10244 --><!--line 0 --><!--description ZmVhdChhY3Rpb25zKTogc3VwcG9ydCByZWZlcmVuY2luZyAke3sgbmVlZHMuLi4gfX0gdmFyaWFibGVzIGluIGBzdHJhdGVneS5tYXRyaXhg-->feat(actions): support referencing ${{ needs... }} variables in `strategy.matrix`<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10244 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
152 lines
3.4 KiB
YAML
152 lines
3.4 KiB
YAML
-
|
|
id: 900
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 4
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 901
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 5
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 902
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 6
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 903
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 7
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 904
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 8
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 905
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 9
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 906
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 10
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|
|
-
|
|
id: 907
|
|
title: "running workflow_dispatch run"
|
|
repo_id: 63
|
|
owner_id: 2
|
|
workflow_id: "running.yaml"
|
|
index: 11
|
|
trigger_user_id: 2
|
|
ref: "refs/heads/main"
|
|
commit_sha: "97f29ee599c373c729132a5c46a046978311e0ee"
|
|
trigger_event: "workflow_dispatch"
|
|
is_fork_pull_request: 0
|
|
status: 6 # running
|
|
started: 1683636528
|
|
created: 1683636108
|
|
updated: 1683636626
|
|
need_approval: 0
|
|
approved_by: 0
|
|
concurrency_group: abc123
|