From 65dd9d4998a3f75ff52428fc31400fcb07abf4be Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 30 Jul 2025 07:35:48 +0000 Subject: [PATCH] fix: allow expressions in step and job uses: (#766) Resolves forgejo/runner#764 - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/766): fix: allow expressions in step and job uses: Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/766 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- act/schema/schema_test.go | 3 ++- act/schema/workflow_schema.json | 37 ++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/act/schema/schema_test.go b/act/schema/schema_test.go index cd7e6640..b9fd64e6 100644 --- a/act/schema/schema_test.go +++ b/act/schema/schema_test.go @@ -60,6 +60,7 @@ jobs: steps: - run: exit 0 if: success() || failure() || always() + - uses: https://${{ secrets.PAT }}@example.com/action/here@v1 `), &node) if !assert.NoError(t, err) { return @@ -107,7 +108,7 @@ jobs: runs-on: ubuntu-latest container: image: code.forgejo.org/oci/node:22-bookworm - uses: ./.github/workflows/build.yaml + uses: ./.forgejo/workflows/${{ vars.PATHNAME }} with: STAGE: dev secrets: diff --git a/act/schema/workflow_schema.json b/act/schema/workflow_schema.json index a0c9b11b..5ec66e17 100644 --- a/act/schema/workflow_schema.json +++ b/act/schema/workflow_schema.json @@ -1469,7 +1469,7 @@ }, "uses": { "description": "The location and version of a reusable workflow file to run as a job. Use one of the following formats:\n\n* `{owner}/{repo}/.github/workflows/{filename}@{ref}` for reusable workflows in public and private repositories.\n* `./.github/workflows/{filename}` for reusable workflows in the same repository.\n\n{ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security.", - "type": "non-empty-string", + "type": "job-uses", "required": true }, "runs-on": { @@ -1798,11 +1798,46 @@ } }, "step-uses": { + "context": [ + "forge", + "github", + "inputs", + "vars", + "needs", + "strategy", + "matrix", + "secrets", + "steps", + "job", + "runner", + "env", + "hashFiles(1,255)" + ], "description": "Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.", "string": { "require-non-empty": true } }, + "job-uses": { + "context": [ + "forge", + "github", + "inputs", + "vars", + "needs", + "strategy", + "matrix", + "secrets", + "steps", + "job", + "runner", + "env", + "hashFiles(1,255)" + ], + "string": { + "require-non-empty": true + } + }, "step-continue-on-error": { "context": [ "forge",