nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
54.61k stars 1.36k forks source link

Steps Not Skipped with env.ACT #1687

Closed andrewvaughan closed 1 year ago

andrewvaughan commented 1 year ago

Bug report info

act version:            0.2.43
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
        /Users/andrew/.docker/run/docker.sock
Config files:           
        /Users/andrew/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.20.1
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.43
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
Docker Engine:
        Engine version:        20.10.23
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             5.15.49-linuxkit
        OS CPU:                4
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act --container-architecture linux/amd64 pull_request

Describe issue

I'm attempting to skip a step that is not required and fails when running locally.

It seems that the documented skip method for using the env.ACT variable is not working, possibly due to being in-tandem with another conditional. The step is the following (from mega-linter):

- name: Archive production artifacts
        if: ${{ !env.ACT }} && ( ${{ success() }} || ${{ failure() }} )
        uses: actions/upload-artifact@v3
        with:
          name: MegaLinter reports
          path: |
            megalinter-reports
            mega-linter.log

Regardless, this method always runs. I've been able to confirm that env.ACT is equal to true on the local platform.

Link to GitHub repository

No response

Workflow content

---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter

on:
  # Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
  #push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
  pull_request:
    branches: [master, main]

# Allow only read permissions, by default
permissions: read-all

# env: # Comment env block if you do not want to apply fixes
#   # Apply linter fixes configuration
#   # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or
#   # other CI tool)
#   APPLY_FIXES: none
#   # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
#   APPLY_FIXES_EVENT: pull_request
#   # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
#   APPLY_FIXES_MODE: commit

concurrency:
  group: ${{ github.ref }}-${{ github.workflow }}
  cancel-in-progress: true

jobs:
  build:
    name: MegaLinter
    runs-on: ubuntu-latest
    steps:

      - name: Announce Environment
        run: |
          echo "##### Performing a ${{ env.ACT && 'DEVELOPMENT' || 'PRODUCTION' }} test sequence #####"

      # Git Checkout
      - name: Checkout Code
        uses: actions/checkout@v3
        with:
          token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
          fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances

      # MegaLinter
      - name: MegaLinter
        id: ml
        # You can override MegaLinter flavor used to have faster performances
        # More info at https://megalinter.io/flavors/
        uses: oxsecurity/megalinter/flavors/documentation@v6
        env:
          # All available variables are described in documentation https://megalinter.io/configuration/
          # Only validate full codebase on main/develop push
          VALIDATE_ALL_CODEBASE: |
            ${{
              github.event_name == 'push'
              && ( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' )
            }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY

      # Upload MegaLinter artifacts (skipped on local tests)
      - name: Archive production artifacts
        if: ${{ ! env.ACT }} && ( ${{ success() }} || ${{ failure() }} )
        uses: actions/upload-artifact@v3
        with:
          name: MegaLinter reports
          path: |
            megalinter-reports
            mega-linter.log

      # # Create pull request if applicable (for now works only on PR from same repository, not from forks)
      # - name: Create Pull Request with applied fixes
      #   id: cpr
      #   if: |
      #     steps.ml.outputs.has_updated_sources == 1
      #     && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name)
      #     && env.APPLY_FIXES_MODE == 'pull_request'
      #     && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
      #     && !contains(github.event.head_commit.message, 'skip fix')
      #   uses: peter-evans/create-pull-request@v4
      #   with:
      #     token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
      #     commit-message: "[MegaLinter] Apply linters automatic fixes"
      #     title: "[MegaLinter] Apply linters automatic fixes"
      #     labels: bot

      # - name: Create PR output
      #   if: |
      #     steps.ml.outputs.has_updated_sources == 1
      #     && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name)
      #     && env.APPLY_FIXES_MODE == 'pull_request'
      #     && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
      #     && !contains(github.event.head_commit.message, 'skip fix')
      #   run: |
      #     echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
      #     echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

      # # Push new commit if applicable (for now works only on PR from same repository, not from forks)
      # - name: Prepare commit
      #   if: |
      #     steps.ml.outputs.has_updated_sources == 1
      #     && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name)
      #     && env.APPLY_FIXES_MODE == 'commit'
      #     && github.ref != 'refs/heads/main'
      #     && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
      #     && !contains(github.event.head_commit.message, 'skip fix')
      #   run: |
      #     sudo chown -Rc $UID .git/

      # - name: Commit and push applied linter fixes
      #   if: |
      #     steps.ml.outputs.has_updated_sources == 1
      #     && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name)
      #     && env.APPLY_FIXES_MODE == 'commit'
      #     && github.ref != 'refs/heads/main'
      #     && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
      #     && !contains(github.event.head_commit.message, 'skip fix')
      #   uses: stefanzweifel/git-auto-commit-action@v4
      #   with:
      #     branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
      #     commit_message: "[MegaLinter] Apply linters fixes"

Relevant log output

// ... the entire job runs successfully, until reaching the step listed above ...

[MegaLinter/MegaLinter]   ⚙  ::set-output:: has_updated_sources=0
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] setupEnv => map[ACT:true CI:true GITHUB_ACTION:3 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: GITHUB_ACTION_REF:v3 GITHUB_ACTION_REPOSITORY:actions/upload-artifact GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_REF:refs/pull/%!f(<nil>)/merge GITHUB_REF_NAME: GITHUB_REF_TYPE: GITHUB_REPOSITORY:root-and-blades/.github GITHUB_REPOSITORY_OWNER:root-and-blades GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e GITHUB_TOKEN: GITHUB_WORKFLOW:MegaLinter GITHUB_WORKSPACE:/Users/andrew/Repositories/Root and Blades, LLC/.github INPUT_NAME:MegaLinter reports INPUT_PATH:megalinter-reports
mega-linter.log
 ImageOS:ubuntu20 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:]
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] expression '${{ ! env.ACT }} && ( ${{ success() }} || ${{ failure() }} )' rewritten to 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] evaluating expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())' evaluated to '%!t(string=false && ( true || false ))'
[MegaLinter/MegaLinter] ⭐ Run Main Archive production artifacts
[MegaLinter/MegaLinter] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
[MegaLinter/MegaLinter] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
[MegaLinter/MegaLinter] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
[MegaLinter/MegaLinter] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[MegaLinter/MegaLinter] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
[MegaLinter/MegaLinter] [DEBUG] Extracting content to '/var/run/act'
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] About to run action &{Upload a Build Artifact GitHub Upload a build artifact that can be used by subsequent workflow steps map[if-no-files-found:{The desired behavior if no files are found using the provided path.
Available Options:
  warn: Output a warning but do not fail the action
  error: Fail the action with an error message
  ignore: Do not output any warnings or errors, the action does not fail
 false warn} name:{Artifact name false artifact} path:{A file, directory or wildcard pattern that describes what to upload true } retention-days:{Duration after which artifact will expire in days. 0 means using default retention.
Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
 false }] map[] {node16 map[] dist/index.js  always()  always()   [] []} { }}
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
[MegaLinter/MegaLinter] [DEBUG] type=remote-action actionDir=/Users/andrew/.cache/act/actions-upload-artifact@v3 actionPath= workdir=/Users/andrew/Repositories/Root and Blades, LLC/.github actionCacheDir=/Users/andrew/.cache/act actionName=actions-upload-artifact@v3 containerActionDir=/var/run/act/actions/actions-upload-artifact@v3
[MegaLinter/MegaLinter] [DEBUG] Removing /Users/andrew/.cache/act/actions-upload-artifact@v3/.gitignore before docker cp
[MegaLinter/MegaLinter] [DEBUG] /var/run/act/actions/actions-upload-artifact@v3
[MegaLinter/MegaLinter]   🐳  docker cp src=/Users/andrew/.cache/act/actions-upload-artifact@v3/ dst=/var/run/act/actions/actions-upload-artifact@v3/
[MegaLinter/MegaLinter] [DEBUG] Writing tarball /var/folders/c1/lhcsclfx6gz8f62fx86rn0940000gn/T/act2947784876 from /Users/andrew/.cache/act/actions-upload-artifact@v3/
[MegaLinter/MegaLinter] [DEBUG] Stripping prefix:/Users/andrew/.cache/act/actions-upload-artifact@v3/ src:/Users/andrew/.cache/act/actions-upload-artifact@v3/
[MegaLinter/MegaLinter] [DEBUG] Extracting content from '/var/folders/c1/lhcsclfx6gz8f62fx86rn0940000gn/T/act2947784876' to '/var/run/act/actions/actions-upload-artifact@v3/'
[MegaLinter/MegaLinter] [DEBUG] executing remote job container: [node /var/run/act/actions/actions-upload-artifact@v3/dist/index.js]
[MegaLinter/MegaLinter]   🐳  docker exec cmd=[node /var/run/act/actions/actions-upload-artifact@v3/dist/index.js] user= workdir=
[MegaLinter/MegaLinter] [DEBUG] Exec command '[node /var/run/act/actions/actions-upload-artifact@v3/dist/index.js]'
[MegaLinter/MegaLinter] [DEBUG] Working directory '/Users/andrew/Repositories/Root and Blades, LLC/.github'
[MegaLinter/MegaLinter]   💬  ::debug::followSymbolicLinks 'true'
[MegaLinter/MegaLinter]   💬  ::debug::implicitDescendants 'true'
[MegaLinter/MegaLinter]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[MegaLinter/MegaLinter]   💬  ::debug::followSymbolicLinks 'true'
[MegaLinter/MegaLinter]   💬  ::debug::implicitDescendants 'true'
[MegaLinter/MegaLinter]   💬  ::debug::matchDirectories 'true'
[MegaLinter/MegaLinter]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[MegaLinter/MegaLinter]   💬  ::debug::Search path '/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports'
[MegaLinter/MegaLinter]   💬  ::debug::Search path '/Users/andrew/Repositories/Root and Blades, LLC/.github/mega-linter.log'
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.checkov.yml was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.eslintrc-json.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.gitleaks.toml was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.markdown-link-check.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.markdownlint.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.secretlintrc.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.vscode from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.vscode/extensions.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config/.yamllint.yml was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/IDE-config.txt was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-ACTION_ACTIONLINT.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-COPYPASTE_JSCPD.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-EDITORCONFIG_EDITORCONFIG_CHECKER.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-JSON_ESLINT_PLUGIN_JSONC.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-JSON_JSONLINT.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-JSON_PRETTIER.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-JSON_V8R.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-MARKDOWN_MARKDOWNLINT.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-MARKDOWN_MARKDOWN_LINK_CHECK.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-REPOSITORY_CHECKOV.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-REPOSITORY_GITLEAKS.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-REPOSITORY_GIT_DIFF.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-REPOSITORY_SECRETLINT.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-REPOSITORY_TRIVY.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-SPELL_CSPELL.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-SPELL_MISSPELL.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-YAML_V8R.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/SUCCESS-YAML_YAMLLINT.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/linters_logs/WARNING-YAML_PRETTIER.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/megalinter.log was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.cspell.json was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.github from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.github/install-hooks.sh was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::Removing /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.github/workflows from rawSearchResults because it is a directory
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.github/workflows/mega-linter.yml was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/.mega-linter.yml was found using the provided searchPath
[MegaLinter/MegaLinter]   💬  ::debug::File:/Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports/updated_sources/README.md was found using the provided searchPath
| Multiple search paths detected. Calculating the least common ancestor of all paths
[MegaLinter/MegaLinter]   💬  ::debug::Using search path /Users/andrew/Repositories/Root and Blades, LLC/.github/megalinter-reports
[MegaLinter/MegaLinter]   💬  ::debug::Using search path /Users/andrew/Repositories/Root and Blades, LLC/.github/mega-linter.log
| The least common ancestor is /Users/andrew/Repositories/Root and Blades, LLC/.github. This will be the root directory of the artifact
| With the provided path, there will be 34 files uploaded
[MegaLinter/MegaLinter]   💬  ::debug::Root artifact directory is /Users/andrew/Repositories/Root and Blades, LLC/.github
| Starting artifact upload
| For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
| Artifact name is valid!
[MegaLinter/MegaLinter]   ❗  ::error::Unable to get ACTIONS_RUNTIME_TOKEN env variable
[MegaLinter/MegaLinter]   ❌  Failure - Main Archive production artifacts
[MegaLinter/MegaLinter] exitcode '1': failure
[MegaLinter/MegaLinter] [DEBUG] skipping post step for 'Checkout Code': no action model available
[MegaLinter/MegaLinter] 🏁  Job failed
[MegaLinter/MegaLinter] [DEBUG] Found revision: a4c037a15c61ead96c0c3e56c4b16cb4bccfc03e
Error: Job 'MegaLinter' failed

Additional information

It might be possible that this is a GitHub runner issue? I'm not sure how act is configured below the hood:

https://github.com/actions/runner/issues/1173

That said, please don't write it off as such! This is just for reference. Thank you so much!

andrewvaughan commented 1 year ago

This seems to be the most pertinent part of the log, if helpful:

[MegaLinter/MegaLinter] [DEBUG] expression '${{ ! env.ACT }} && ( ${{ success() }} || ${{ failure() }} )' rewritten to 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] evaluating expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())' evaluated to '%!t(string=false && ( true || false ))'

Solution?

This seemed to work, but I have not had a chance to test it on GitHub runners yet. Maybe it requires an update to the documentation?

Conditional:

if: ( !env.ACT && ( success() || failure() ) )

Result:

[MegaLinter/MegaLinter] [DEBUG] evaluating expression '( !env.ACT && ( success() || failure() ) )'
[MegaLinter/MegaLinter] [DEBUG] expression '( !env.ACT && ( success() || failure() ) )' evaluated to 'false'
[MegaLinter/MegaLinter] [DEBUG] Skipping step 'Archive production artifacts' due to '( !env.ACT && ( success() || failure() ) )'
ChristopherHX commented 1 year ago

I'm aware of this problem, but there are multiple mutable exclusive solutions.

github-actions[bot] commented 1 year ago

Issue is stale and will be closed in 14 days unless there is new activity

jamincollins commented 6 months ago

@ChristopherHX could you please provide the examples with multiple conditions? I've checked both of the above links and neither of them seem to cover cases with multiple conditions.