runner icon indicating copy to clipboard operation
runner copied to clipboard

Aliases in macos runners not working

Open sidekick-eimantas opened this issue 2 years ago • 3 comments

Describe the bug Alises in macos runners are not being expanded

Expected behavior Aliases expanded

Runner Version and Platform

Runner version: 2.303.0 OS: macos-12

What's not working?

Workflow

on:
  push:
    branches:
      - debug-p

defaults:
  run:
    shell: bash -ieo pipefail {0}

jobs:
  test:
    runs-on: "macos-12"
    steps:
      - run: echo "echo ~/.bashrc was sourced" >> ~/.bashrc
      - run: echo "shopt -s expand_aliases" >> ~/.bashrc
      - run: echo "alias p=ls" >> ~/.bashrc
      - run: p

Logs

2023-04-17T02:08:52.7146126Z Requested labels: macos-12
2023-04-17T02:08:52.7146430Z Job defined at: sidekickmoney/skm-cli/.github/workflows/test.yml@refs/heads/debug-p
2023-04-17T02:08:52.7146541Z Waiting for a runner to pick up this job...
2023-04-17T02:08:52.9265834Z Job is waiting for a hosted runner to come online.
2023-04-17T02:08:59.9917144Z Job is about to start running on the hosted runner: GitHub Actions 2 (hosted)
2023-04-17T02:09:03.8795160Z Current runner version: '2.303.0'
2023-04-17T02:09:03.8838100Z ##[group]Operating System
2023-04-17T02:09:03.8839000Z macOS
2023-04-17T02:09:03.8839360Z 12.6.5
2023-04-17T02:09:03.8839640Z 21G531
2023-04-17T02:09:03.8840020Z ##[endgroup]
2023-04-17T02:09:03.8840490Z ##[group]Runner Image
2023-04-17T02:09:03.8840880Z Image: macos-12
2023-04-17T02:09:03.8841280Z Version: 20230411.1
2023-04-17T02:09:03.8841870Z Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230411.1/images/macos/macos-12-Readme.md
2023-04-17T02:09:03.8842680Z Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230411.1
2023-04-17T02:09:03.8843240Z ##[endgroup]
2023-04-17T02:09:03.8844470Z ##[group]Runner Image Provisioner
2023-04-17T02:09:03.8844910Z 2.0.139.1
2023-04-17T02:09:03.8845230Z ##[endgroup]
2023-04-17T02:09:03.8846510Z ##[group]GITHUB_TOKEN Permissions
2023-04-17T02:09:03.8847320Z Actions: write
2023-04-17T02:09:03.8847710Z Checks: write
2023-04-17T02:09:03.8848310Z Contents: write
2023-04-17T02:09:03.8848910Z Deployments: write
2023-04-17T02:09:03.8849330Z Discussions: write
2023-04-17T02:09:03.8849710Z Issues: write
2023-04-17T02:09:03.8850150Z Metadata: read
2023-04-17T02:09:03.8850490Z Packages: write
2023-04-17T02:09:03.8850870Z Pages: write
2023-04-17T02:09:03.8851260Z PullRequests: write
2023-04-17T02:09:03.8851630Z RepositoryProjects: write
2023-04-17T02:09:03.8852140Z SecurityEvents: write
2023-04-17T02:09:03.8852560Z Statuses: write
2023-04-17T02:09:03.8852900Z ##[endgroup]
2023-04-17T02:09:03.8857940Z Secret source: Actions
2023-04-17T02:09:03.8858700Z Prepare workflow directory
2023-04-17T02:09:04.0185840Z Prepare all required actions
2023-04-17T02:09:04.0518850Z Complete job name: test
2023-04-17T02:09:04.2824530Z ##[group]Run echo "echo ~/.bashrc was sourced" >> ~/.bashrc
2023-04-17T02:09:04.2825160Z [36;1mecho "echo ~/.bashrc was sourced" >> ~/.bashrc[0m
2023-04-17T02:09:04.9252260Z shell: /bin/bash -ieo pipefail {0}
2023-04-17T02:09:04.9252650Z ##[endgroup]
2023-04-17T02:09:05.0189990Z bash: no job control in this shell
2023-04-17T02:09:05.2807120Z ##[group]Run echo "shopt -s expand_aliases" >> ~/.bashrc
2023-04-17T02:09:05.2808020Z [36;1mecho "shopt -s expand_aliases" >> ~/.bashrc[0m
2023-04-17T02:09:05.3007910Z shell: /bin/bash -ieo pipefail {0}
2023-04-17T02:09:05.3008390Z ##[endgroup]
2023-04-17T02:09:05.3312620Z bash: no job control in this shell
2023-04-17T02:09:05.6043910Z /Users/runner/.bashrc was sourced
2023-04-17T02:09:05.6693170Z ##[group]Run echo "alias p=ls" >> ~/.bashrc
2023-04-17T02:09:05.6693690Z [36;1mecho "alias p=ls" >> ~/.bashrc[0m
2023-04-17T02:09:05.6886850Z shell: /bin/bash -ieo pipefail {0}
2023-04-17T02:09:05.6887520Z ##[endgroup]
2023-04-17T02:09:05.7181790Z bash: no job control in this shell
2023-04-17T02:09:05.9671250Z /Users/runner/.bashrc was sourced
2023-04-17T02:09:05.9818170Z ##[group]Run p
2023-04-17T02:09:05.9818600Z [36;1mp[0m
2023-04-17T02:09:06.0015650Z shell: /bin/bash -ieo pipefail {0}
2023-04-17T02:09:06.0016010Z ##[endgroup]
2023-04-17T02:09:06.0315990Z bash: no job control in this shell
2023-04-17T02:09:06.2668570Z /Users/runner/.bashrc was sourced
2023-04-17T02:09:06.2687930Z /Users/runner/work/_temp/7ee494c1-45e2-4b17-94f2-5f2f3963b90c.sh: line 1: p: command not found
2023-04-17T02:09:06.2715670Z ##[error]Process completed with exit code 127.
2023-04-17T02:09:06.2937660Z Cleaning up orphan processes

This works perfectly fine on ubuntu. I must be missing something that needs to be done on macos for this to work?

Thanks

sidekick-eimantas avatar Apr 17 '23 02:04 sidekick-eimantas

Seems to work if you change shell to zsh instead

sidekick-eimantas avatar Apr 17 '23 02:04 sidekick-eimantas

@ruvceskistefan "Seems to work if you change shell to zsh instead" does not mean this is not a bug We don't use "zsh" in CI/CD

sidekick-eimantas avatar Apr 27 '23 11:04 sidekick-eimantas

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Apr 29 '24 00:04 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar May 20 '24 00:05 github-actions[bot]