[GH-ISSUE #926] Issue: Bug running composite actions #547

Closed
opened 2026-03-01 21:44:23 +03:00 by kerem · 1 comment
Owner

Originally created by @jackton1 on GitHub (Dec 14, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/926

System information

  • Operating System: macOS
  • Architecture: arm64 (64-bit)
  • Apple M1: yes
  • Docker version: 20.10.10
  • Docker image used in act:
  • act version: 0.2.25

Expected behaviour

I expected the output of a composite action to be used as an environment variable to a subsequent step

Actual behaviour

The logs shows the output getting set but the succeeding action run doesn't reflect the value.

Workflow and/or repository

https://github.com/tj-actions/changed-files/issues/251

  1. Add action to repo as configured below
  2. Add multiple changed files in commit, but only 1 with a .yaml extension
  3. Run action locally with act
name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Get changes
        id: changes
        uses: tj-actions/changed-files@v11.6
        with:
          files: \.yaml$

      - name: Show changes
        shell: bash
        run: |
          set -euo pipefail

          for file in ${{ steps.changes.outputs.all_modified_files }}
          do
            echo "${file}"
          done

act output

Log
[CI/Test changed-files-1] ⭐  Run Run changed-files with specific files
[CI/Test changed-files-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/source-input-files.sh] user= workdir=
[CI/Test changed-files-1]   ❓  ::group::changed-files-from-source-file
| Input Files: .github/workflows/test.yml action.yml
| All Unique Input files: .github/workflows/test.yml action.yml
[CI/Test changed-files-1]   ⚙  ::set-output:: files=.github/workflows/test.yml action.yml
[CI/Test changed-files-1]   ❓  ::endgroup::
[CI/Test changed-files-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/base-sha.sh] user= workdir=
[CI/Test changed-files-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/changed-files.sh] user= workdir=
[CI/Test changed-files-1]   ❓  ::group::changed-files
| Resolving repository path...
| Setting up 'temp_changed_files' remote...
| No 'temp_changed_files' remote found
| Creating 'temp_changed_files' remote...
| Getting HEAD info...
| Retrieving changes between c4ea3ea9f8b2a15ae4ded5e2c378767cdf602430 (feature/renamed-all-modified-files-to-all-changed-files) → e6690a2188bbc45dfdcc1d322d5566f421bb45b8 (feature/renamed-all-modified-files-to-all-changed-files)
| Getting diff...
| Added files: 
| Copied files: 
| Deleted files: 
| Modified files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
| Renamed files: 
| Type Changed files: 
| Unmerged files: 
| Unknown files: 
| All changed and modified files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
| All changed files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
[CI/Test changed-files-1]   ⚙  ::set-output:: added_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: copied_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: deleted_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: modified_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
[CI/Test changed-files-1]   ⚙  ::set-output:: renamed_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: type_changed_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: unmerged_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: unknown_files=
[CI/Test changed-files-1]   ⚙  ::set-output:: all_changed_and_modified_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
[CI/Test changed-files-1]   ⚙  ::set-output:: all_changed_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh
[CI/Test changed-files-1]   ❓  ::endgroup::
[CI/Test changed-files-1]   ✅  Success - Run changed-files with specific files
[CI/Test changed-files-1] ⭐  Run Show output
[CI/Test changed-files-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/12.sh] user= workdir=
| {
|   "added_files": "",
|   "all_changed_and_modified_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh",
|   "all_changed_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh",
|   "copied_files": "",
|   "deleted_files": "",
|   "files": ".github/workflows/test.yml action.yml",
|   "modified_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh",
|   "renamed_files": "",
|   "type_changed_files": "",
|   "unknown_files": "",
|   "unmerged_files": ""
| }
[CI/Test changed-files-1]   ✅  Success - Show output
[CI/Test changed-files-1] ⭐  Run Verify any_deleted for specific files
[CI/Test changed-files-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/14.sh] user= workdir=
| Invalid output: Expected (false) got ()
[CI/Test changed-files-1]   ❌  Failure - Verify any_deleted for specific files
Error: exit with `FAILURE`: 1
Originally created by @jackton1 on GitHub (Dec 14, 2021). Original GitHub issue: https://github.com/nektos/act/issues/926 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## System information <!-- - Operating System: < Windows | Linux | macOS | etc... > - Architecture: < x64 (64-bit) | x86 (32-bit) | arm64 (64-bit) | arm (32-bit) | etc... > - Apple M1: < yes | no > - Docker version: < output of `docker system info -f "{{.ServerVersion}}"` > - Docker image used in `act`: < can be omitted if it's included in log > - `act` version: < output of `act --version`, if you've built `act` yourself, please provide commit hash > --> - Operating System: macOS - Architecture: arm64 (64-bit) - Apple M1: yes - Docker version: 20.10.10 - Docker image used in `act`: - `act` version: 0.2.25 ## Expected behaviour <!-- - Describe how whole process should go and finish --> I expected the output of a composite action to be used as an environment variable to a subsequent step ## Actual behaviour <!-- - Describe the issue --> The logs shows the output getting set but the succeeding action run doesn't reflect the value. ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow <details> <summary>workflow</summary> ```none name: example workflow on: [push] jobs: [...] ``` </details> ## Steps to reproduce <!-- - Make sure to include full command with parameters you used to run `act`, example: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> https://github.com/tj-actions/changed-files/issues/251 1. Add action to repo as configured below 2. Add multiple changed files in commit, but only 1 with a _.yaml_ extension 2. Run action locally with `act` ```yaml name: Test on: push: jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Get changes id: changes uses: tj-actions/changed-files@v11.6 with: files: \.yaml$ - name: Show changes shell: bash run: | set -euo pipefail for file in ${{ steps.changes.outputs.all_modified_files }} do echo "${file}" done ``` ## `act` output <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ```none [CI/Test changed-files-1] ⭐ Run Run changed-files with specific files [CI/Test changed-files-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/source-input-files.sh] user= workdir= [CI/Test changed-files-1] ❓ ::group::changed-files-from-source-file | Input Files: .github/workflows/test.yml action.yml | All Unique Input files: .github/workflows/test.yml action.yml [CI/Test changed-files-1] ⚙ ::set-output:: files=.github/workflows/test.yml action.yml [CI/Test changed-files-1] ❓ ::endgroup:: [CI/Test changed-files-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/base-sha.sh] user= workdir= [CI/Test changed-files-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/changed-files.sh] user= workdir= [CI/Test changed-files-1] ❓ ::group::changed-files | Resolving repository path... | Setting up 'temp_changed_files' remote... | No 'temp_changed_files' remote found | Creating 'temp_changed_files' remote... | Getting HEAD info... | Retrieving changes between c4ea3ea9f8b2a15ae4ded5e2c378767cdf602430 (feature/renamed-all-modified-files-to-all-changed-files) → e6690a2188bbc45dfdcc1d322d5566f421bb45b8 (feature/renamed-all-modified-files-to-all-changed-files) | Getting diff... | Added files: | Copied files: | Deleted files: | Modified files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh | Renamed files: | Type Changed files: | Unmerged files: | Unknown files: | All changed and modified files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh | All changed files: .github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh [CI/Test changed-files-1] ⚙ ::set-output:: added_files= [CI/Test changed-files-1] ⚙ ::set-output:: copied_files= [CI/Test changed-files-1] ⚙ ::set-output:: deleted_files= [CI/Test changed-files-1] ⚙ ::set-output:: modified_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh [CI/Test changed-files-1] ⚙ ::set-output:: renamed_files= [CI/Test changed-files-1] ⚙ ::set-output:: type_changed_files= [CI/Test changed-files-1] ⚙ ::set-output:: unmerged_files= [CI/Test changed-files-1] ⚙ ::set-output:: unknown_files= [CI/Test changed-files-1] ⚙ ::set-output:: all_changed_and_modified_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh [CI/Test changed-files-1] ⚙ ::set-output:: all_changed_files=.github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh [CI/Test changed-files-1] ❓ ::endgroup:: [CI/Test changed-files-1] ✅ Success - Run changed-files with specific files [CI/Test changed-files-1] ⭐ Run Show output [CI/Test changed-files-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/12.sh] user= workdir= | { | "added_files": "", | "all_changed_and_modified_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh", | "all_changed_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh", | "copied_files": "", | "deleted_files": "", | "files": ".github/workflows/test.yml action.yml", | "modified_files": ".github/workflows/test.yml HISTORY.md README.md action.yml entrypoint.sh", | "renamed_files": "", | "type_changed_files": "", | "unknown_files": "", | "unmerged_files": "" | } [CI/Test changed-files-1] ✅ Success - Show output [CI/Test changed-files-1] ⭐ Run Verify any_deleted for specific files [CI/Test changed-files-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jacktonye/workspace/changed-files/workflow/14.sh] user= workdir= | Invalid output: Expected (false) got () [CI/Test changed-files-1] ❌ Failure - Verify any_deleted for specific files Error: exit with `FAILURE`: 1 ``` </details>
kerem 2026-03-01 21:44:23 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Dec 14, 2021):

Please check my PR https://github.com/nektos/act/pull/793

This fixes the outputs of composite actions

The tests of act v0.2.25 were invalid and tested the non existent step context.

<!-- gh-comment-id:993328974 --> @ChristopherHX commented on GitHub (Dec 14, 2021): Please check my PR https://github.com/nektos/act/pull/793 This fixes the outputs of composite actions The tests of act v0.2.25 were invalid and tested the non existent `step` context.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/act#547
No description provided.