chore: remove workflow command add-path #1616

Merged
mfenniak merged 1 commit from aahlenst/runner:remove-add-path into main 2026-07-15 01:09:19 +00:00
Member

The workflow command add-path allows amending PATH that is injected into successive steps. Unfortunately, it is difficult to use securely. Therefore, it is removed from Forgejo Runner. If workflows still use add-path, a warning will be printed. Contrary to GitHub Actions, it is not possible to restore it again by setting the environment variable ACTIONS_ALLOW_UNSECURE_COMMANDS=true because better alternatives exist. Workflows that need to amend PATH of successive steps should write to $FORGEJO_PATH:

on:
  push:
jobs:
  test:
    runs-on: debian
    steps:
      - run: |
          echo "/add-to-path" > "$FORGEJO_PATH"
      - run: |
          echo "$PATH"

See #1455 and GitHub Actions: Deprecating set-env and add-path commands.

  • other
    • PR: chore: remove workflow command add-path
The workflow command `add-path` allows amending `PATH` that is injected into successive steps. Unfortunately, it is difficult to use securely. Therefore, it is removed from Forgejo Runner. If workflows still use `add-path`, a warning will be printed. Contrary to GitHub Actions, it is not possible to restore it again by setting the environment variable `ACTIONS_ALLOW_UNSECURE_COMMANDS=true` because better alternatives exist. Workflows that need to amend `PATH` of successive steps should write to `$FORGEJO_PATH`: ```yaml on: push: jobs: test: runs-on: debian steps: - run: | echo "/add-to-path" > "$FORGEJO_PATH" - run: | echo "$PATH" ``` See https://code.forgejo.org/forgejo/runner/issues/1455 and [GitHub Actions: Deprecating set-env and add-path commands](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/#patching-your-actions-and-workflows). <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/1616): <!--number 1616 --><!--line 0 --><!--description Y2hvcmU6IHJlbW92ZSB3b3JrZmxvdyBjb21tYW5kIGFkZC1wYXRo-->chore: remove workflow command add-path<!--description--> <!--end release-notes-assistant-->
Author
Member

This function

Lines 129 to 138 in 04be7a7
func (rc *RunContext) addPath(ctx context.Context, arg string) {
common.Logger(ctx).WithFields(logrus.Fields{"command": "add-path", "arg": arg}).Infof(" \U00002699 ::add-path:: %s", arg)
extraPath := []string{arg}
for _, v := range rc.ExtraPath {
if v != arg {
extraPath = append(extraPath, v)
}
}
rc.ExtraPath = extraPath
}

is still needed. However, I'm a bit unsure what to do about the log message

common.Logger(ctx).WithFields(logrus.Fields{"command": "add-path", "arg": arg}).Infof("  \U00002699  ::add-path:: %s", arg)

because it still refers to the command add-path.

This function https://code.forgejo.org/forgejo/runner/src/commit/04be7a7956798fe87d4c786775c0a3ffb8456b2d/act/runner/command.go#L129-L138 is still needed. However, I'm a bit unsure what to do about the log message ``` common.Logger(ctx).WithFields(logrus.Fields{"command": "add-path", "arg": arg}).Infof(" \U00002699 ::add-path:: %s", arg) ``` because it still refers to the command `add-path`.
Contributor

cascading-pr updated at actions/setup-forgejo#1039

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/1039
Owner

@aahlenst wrote in #1616 (comment):

However, I'm a bit unsure what to do about the log message...

The first concern with logging in runner is always, "is it really logging, or does it do something functional"? Surely it can't be functional here because that would be causing an infinite loop in the command handler, so pretty confident that isn't the case.

Maybe just change it to indicate %q was added to PATH?

@aahlenst wrote in https://code.forgejo.org/forgejo/runner/pulls/1616#issuecomment-94213: > However, I'm a bit unsure what to do about the log message... The first concern with logging in runner is always, "is it really logging, or does it do something functional"? Surely it can't be functional here because that would be causing an infinite loop in the command handler, so pretty confident that isn't the case. Maybe just change it to indicate `%q was added to PATH`?
aahlenst force-pushed remove-add-path from 806290f037
All checks were successful
cascade / debug (pull_request_target) Has been skipped
cascade / forgejo (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
checks / validate mocks (pull_request) Successful in 24s
checks / Build Forgejo Runner (pull_request) Successful in 29s
checks / validate pre-commit-hooks file (pull_request) Successful in 31s
checks / Build unsupported platforms (pull_request) Successful in 22s
checks / runner exec tests (pull_request) Successful in 28s
checks / Run integration tests with Docker (docker-latest) (pull_request) Successful in 9m49s
checks / Run integration tests with Podman (pull_request) Successful in 10m37s
checks / Run integration tests with Docker (docker-stable) (pull_request) Successful in 12m5s
test-multi-platform / arm64 (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 3s
cascade / end-to-end (pull_request_target) Successful in 26m41s
to 85088b4ba6
Some checks failed
cascade / debug (pull_request_target) Has been skipped
cascade / forgejo (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
test-multi-platform / arm64 (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 6s
checks / validate mocks (pull_request) Successful in 20s
checks / Build Forgejo Runner (pull_request) Successful in 28s
checks / validate pre-commit-hooks file (pull_request) Successful in 31s
checks / runner exec tests (pull_request) Successful in 38s
checks / Build unsupported platforms (pull_request) Successful in 53s
cascade / end-to-end (pull_request_target) Has been cancelled
checks / Run integration tests with Podman (pull_request) Has been cancelled
checks / Run integration tests with Docker (docker-stable) (pull_request) Has been cancelled
checks / Run integration tests with Docker (docker-latest) (pull_request) Has been cancelled
Integration tests for the release process / release-simulation (pull_request) Successful in 4m52s
2026-07-12 12:03:32 +00:00
Compare
Contributor

cascading-pr updated at actions/setup-forgejo#1039

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/1039
aahlenst force-pushed remove-add-path from 85088b4ba6
Some checks failed
cascade / debug (pull_request_target) Has been skipped
cascade / forgejo (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
test-multi-platform / arm64 (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 6s
checks / validate mocks (pull_request) Successful in 20s
checks / Build Forgejo Runner (pull_request) Successful in 28s
checks / validate pre-commit-hooks file (pull_request) Successful in 31s
checks / runner exec tests (pull_request) Successful in 38s
checks / Build unsupported platforms (pull_request) Successful in 53s
cascade / end-to-end (pull_request_target) Has been cancelled
checks / Run integration tests with Podman (pull_request) Has been cancelled
checks / Run integration tests with Docker (docker-stable) (pull_request) Has been cancelled
checks / Run integration tests with Docker (docker-latest) (pull_request) Has been cancelled
Integration tests for the release process / release-simulation (pull_request) Successful in 4m52s
to 686b364275
Some checks failed
cascade / debug (pull_request_target) Has been skipped
cascade / forgejo (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
test-multi-platform / arm64 (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / validate mocks (pull_request) Successful in 23s
checks / Build Forgejo Runner (pull_request) Successful in 30s
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / Build unsupported platforms (pull_request) Successful in 56s
checks / runner exec tests (pull_request) Successful in 29s
cascade / end-to-end (pull_request_target) Failing after 6m52s
checks / Run integration tests with Docker (docker-latest) (pull_request) Successful in 9m52s
checks / Run integration tests with Podman (pull_request) Successful in 11m26s
checks / Run integration tests with Docker (docker-stable) (pull_request) Successful in 11m44s
2026-07-12 12:05:20 +00:00
Compare
Author
Member

@mfenniak wrote in #1616 (comment):

Maybe just change it to indicate %q was added to PATH?

Thanks! Done.

@mfenniak wrote in https://code.forgejo.org/forgejo/runner/pulls/1616#issuecomment-94308: > Maybe just change it to indicate `%q was added to PATH`? Thanks! Done.
Contributor

cascading-pr updated at actions/setup-forgejo#1039

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/1039
aahlenst force-pushed remove-add-path from 686b364275
Some checks failed
cascade / debug (pull_request_target) Has been skipped
cascade / forgejo (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
test-multi-platform / arm64 (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / validate mocks (pull_request) Successful in 23s
checks / Build Forgejo Runner (pull_request) Successful in 30s
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / Build unsupported platforms (pull_request) Successful in 56s
checks / runner exec tests (pull_request) Successful in 29s
cascade / end-to-end (pull_request_target) Failing after 6m52s
checks / Run integration tests with Docker (docker-latest) (pull_request) Successful in 9m52s
checks / Run integration tests with Podman (pull_request) Successful in 11m26s
checks / Run integration tests with Docker (docker-stable) (pull_request) Successful in 11m44s
to a3df21030c
All checks were successful
cascade / debug (pull_request_target) Has been skipped
test-multi-platform / Build Forgejo Runner (pull_request) Has been skipped
test-multi-platform / Build unsupported platforms (pull_request) Has been skipped
test-multi-platform / runner exec tests (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-latest) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Docker (docker-stable) (pull_request) Has been skipped
test-multi-platform / Run integration tests with Podman (pull_request) Has been skipped
test-multi-platform / validate mocks (pull_request) Has been skipped
test-multi-platform / validate pre-commit-hooks file (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / validate mocks (pull_request) Successful in 26s
checks / validate pre-commit-hooks file (pull_request) Successful in 36s
checks / Build Forgejo Runner (pull_request) Successful in 45s
checks / Build unsupported platforms (pull_request) Successful in 1m37s
checks / runner exec tests (pull_request) Successful in 25s
checks / Run integration tests with Docker (docker-latest) (pull_request) Successful in 10m49s
checks / Run integration tests with Podman (pull_request) Successful in 11m6s
checks / Run integration tests with Docker (docker-stable) (pull_request) Successful in 12m41s
test-multi-platform / arm64 (pull_request) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 7s
cascade / forgejo (pull_request_target) Successful in 33s
2026-07-13 20:40:35 +00:00
Compare
Contributor

cascading-pr updated at actions/setup-forgejo#1039

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/1039
mfenniak approved these changes 2026-07-15 01:08:39 +00:00
mfenniak referenced this pull request from a commit 2026-08-24 21:22:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
forgejo/runner!1616
No description provided.