[GH-ISSUE #432] Local installation from composer fails due to ssh authentication missing #300

Closed
opened 2026-03-01 21:42:10 +03:00 by kerem · 2 comments
Owner

Originally created by @dingo-d on GitHub (Nov 28, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/432

I'm trying to test out the action I'm creating locally that looks like this

workflow yaml file

name: Sniff stage - quality control checks

on:
pull_request:
branches: [master, develop]
push:
branches: [master]

jobs:
qa_checks:
name: Quality control checks
runs-on: ubuntu-latest
env:
PHPCS_BRANCH: "dev-master"
WPCS_BRANCH: "dev-master"
strategy:
fail-fast: false

    steps:
        # Checkout repository
        - name: Checkout
          uses: actions/checkout@v2

        # Setup PHP versions, run checks
        - name: PHP setup
          uses: shivammathur/setup-php@v2
          with:
            php-version: '7.4'
            tools: composer:v1

        - name: Get composer cache directory
          id: composer-cache
          run: |
            echo "::set-output name=dir::$(composer config cache-files-dir)"

        - name: Cache composer dependencies
          uses: actions/cache@v1
          with:
            path: ${{ steps.composer-cache.outputs.dir }}
            key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
            restore-keys: |
              ${{ runner.os }}-composer-

        - name: Set the required PHPCS and WPCS versions
          run: composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} wp-coding-standards/wpcs:${WPCS_BRANCH} --no-update --no-scripts

        - name: Install the rest of the dependencies
          run: composer install

        - name: Check the code style of the WPThemeReview codebase
          run: composer check-cs

        - name: Validate xml files
          run: |
            export XMLLINT_INDENT="	"
            xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml

        - name: Check the code-style consistency of the xml files.
          run: diff -B --tabsize=4 ./WPThemeReview/ruleset.xml <(xmllint --format "./WPThemeReview/ruleset.xml")

        - name: Check feature completeness of the available sniffs
          run: composer check-complete

For this repo: https://github.com/WPTT/WPThemeReview

I'm using act -P ubuntu-latest=shivammathur/node:latest command and I get: the error

[Sniff stage - quality control checks/Quality control checks] 🚀  Start image=shivammathur/node:latest
[Sniff stage - quality control checks/Quality control checks]   🐳  docker run image=shivammathur/node:latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Sniff stage - quality control checks/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/Projects/Personal/WPThemeReview/. dst=/github/workspace
[Sniff stage - quality control checks/Quality control checks] ⭐  Run Checkout
[Sniff stage - quality control checks/Quality control checks]   ✅  Success - Checkout
[Sniff stage - quality control checks/Quality control checks] ⭐  Run PHP setup
[Sniff stage - quality control checks/Quality control checks]   ☁  git clone 'https://github.com/shivammathur/setup-php' # ref=v2
[Sniff stage - quality control checks/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/shivammathur-setup-php@v2 dst=/actions/
| [command]/bin/bash /opt/hostedtoolcache/linux.sh 7.4 /actions/shivammathur-setup-php@v2/dist
|
| ==> Setup PHP
| ✓ PHP Found PHP 7.4.12
|
| ==> Setup Tools
| /actions/shivammathur-setup-php@v2/dist/../src/scripts/common.sh: line 180: : No such file or directory
| ✓ composer Added composer 1.10.17
|
| ==> Support this project
| ✓ setup-php https://setup-php.com/support
[Sniff stage - quality control checks/Quality control checks]   ✅  Success - PHP setup
[Sniff stage - quality control checks/Quality control checks] ⭐  Run Get composer cache directory
[Sniff stage - quality control checks/Quality control checks]   ⚙  ::set-output:: dir=/github/home/.composer/cache/files
[Sniff stage - quality control checks/Quality control checks]   ✅  Success - Get composer cache directory
[Sniff stage - quality control checks/Quality control checks] ⭐  Run Cache composer dependencies
[Sniff stage - quality control checks/Quality control checks]   ☁  git clone 'https://github.com/actions/cache' # ref=v1
[Sniff stage - quality control checks/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/actions-cache@v1 dst=/actions/
[Sniff stage - quality control checks/Quality control checks]   💬  ::debug::Cache Path: /github/home/.composer/cache/files
[Sniff stage - quality control checks/Quality control checks]   ❓  ::save-state name=CACHE_KEY,::Linux-composer-97188fe8d7125cf53e8c782841020066d79f0cd4fa5e8d2b573415777a319792
[Sniff stage - quality control checks/Quality control checks]   💬  ::debug::Resolved Keys:
[Sniff stage - quality control checks/Quality control checks]   💬  ::debug::["Linux-composer-97188fe8d7125cf53e8c782841020066d79f0cd4fa5e8d2b573415777a319792","Linux-composer-"]
| [warning]Cache Service Url not found, unable to restore cache.
[Sniff stage - quality control checks/Quality control checks]   ⚙  ::set-output:: cache-hit=false
[Sniff stage - quality control checks/Quality control checks]   ✅  Success - Cache composer dependencies
[Sniff stage - quality control checks/Quality control checks] ⭐  Run Set the required PHPCS and WPCS versions
| ./composer.json has been updated
[Sniff stage - quality control checks/Quality control checks]   ✅  Success - Set the required PHPCS and WPCS versions
[Sniff stage - quality control checks/Quality control checks] ⭐  Run Install the rest of the dependencies
| Loading composer repositories with package information
| Updating dependencies (including require-dev)
| Package operations: 36 installs, 0 updates, 0 removals
|   - Installing squizlabs/php_codesniffer (dev-master cda358f): Cloning cda358face
| Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
| Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+docker-desktop+2020-11-28+1913
| to retrieve a token. It will be stored in "/github/home/.composer/auth.json" for future use by Composer.

But this makes no sense since the repo is public 🤷‍♂️

How can I pass my local credentials to the container when the action is run locally?

Originally created by @dingo-d on GitHub (Nov 28, 2020). Original GitHub issue: https://github.com/nektos/act/issues/432 I'm trying to test out the action I'm creating locally that looks like this <details> <summary>workflow yaml file</summary> <pre><code> name: Sniff stage - quality control checks on: pull_request: branches: [master, develop] push: branches: [master] jobs: qa_checks: name: Quality control checks runs-on: ubuntu-latest env: PHPCS_BRANCH: "dev-master" WPCS_BRANCH: "dev-master" strategy: fail-fast: false steps: # Checkout repository - name: Checkout uses: actions/checkout@v2 # Setup PHP versions, run checks - name: PHP setup uses: shivammathur/setup-php@v2 with: php-version: '7.4' tools: composer:v1 - name: Get composer cache directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- - name: Set the required PHPCS and WPCS versions run: composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} wp-coding-standards/wpcs:${WPCS_BRANCH} --no-update --no-scripts - name: Install the rest of the dependencies run: composer install - name: Check the code style of the WPThemeReview codebase run: composer check-cs - name: Validate xml files run: | export XMLLINT_INDENT=" " xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml - name: Check the code-style consistency of the xml files. run: diff -B --tabsize=4 ./WPThemeReview/ruleset.xml <(xmllint --format "./WPThemeReview/ruleset.xml") - name: Check feature completeness of the available sniffs run: composer check-complete </code></pre> </details> For this repo: https://github.com/WPTT/WPThemeReview I'm using `act -P ubuntu-latest=shivammathur/node:latest` command and I get: the error ```bash [Sniff stage - quality control checks/Quality control checks] 🚀 Start image=shivammathur/node:latest [Sniff stage - quality control checks/Quality control checks] 🐳 docker run image=shivammathur/node:latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Sniff stage - quality control checks/Quality control checks] 🐳 docker cp src=/Users/denis.zoljom/Projects/Personal/WPThemeReview/. dst=/github/workspace [Sniff stage - quality control checks/Quality control checks] ⭐ Run Checkout [Sniff stage - quality control checks/Quality control checks] ✅ Success - Checkout [Sniff stage - quality control checks/Quality control checks] ⭐ Run PHP setup [Sniff stage - quality control checks/Quality control checks] ☁ git clone 'https://github.com/shivammathur/setup-php' # ref=v2 [Sniff stage - quality control checks/Quality control checks] 🐳 docker cp src=/Users/denis.zoljom/.cache/act/shivammathur-setup-php@v2 dst=/actions/ | [command]/bin/bash /opt/hostedtoolcache/linux.sh 7.4 /actions/shivammathur-setup-php@v2/dist | | ==> Setup PHP | ✓ PHP Found PHP 7.4.12 | | ==> Setup Tools | /actions/shivammathur-setup-php@v2/dist/../src/scripts/common.sh: line 180: : No such file or directory | ✓ composer Added composer 1.10.17 | | ==> Support this project | ✓ setup-php https://setup-php.com/support [Sniff stage - quality control checks/Quality control checks] ✅ Success - PHP setup [Sniff stage - quality control checks/Quality control checks] ⭐ Run Get composer cache directory [Sniff stage - quality control checks/Quality control checks] ⚙ ::set-output:: dir=/github/home/.composer/cache/files [Sniff stage - quality control checks/Quality control checks] ✅ Success - Get composer cache directory [Sniff stage - quality control checks/Quality control checks] ⭐ Run Cache composer dependencies [Sniff stage - quality control checks/Quality control checks] ☁ git clone 'https://github.com/actions/cache' # ref=v1 [Sniff stage - quality control checks/Quality control checks] 🐳 docker cp src=/Users/denis.zoljom/.cache/act/actions-cache@v1 dst=/actions/ [Sniff stage - quality control checks/Quality control checks] 💬 ::debug::Cache Path: /github/home/.composer/cache/files [Sniff stage - quality control checks/Quality control checks] ❓ ::save-state name=CACHE_KEY,::Linux-composer-97188fe8d7125cf53e8c782841020066d79f0cd4fa5e8d2b573415777a319792 [Sniff stage - quality control checks/Quality control checks] 💬 ::debug::Resolved Keys: [Sniff stage - quality control checks/Quality control checks] 💬 ::debug::["Linux-composer-97188fe8d7125cf53e8c782841020066d79f0cd4fa5e8d2b573415777a319792","Linux-composer-"] | [warning]Cache Service Url not found, unable to restore cache. [Sniff stage - quality control checks/Quality control checks] ⚙ ::set-output:: cache-hit=false [Sniff stage - quality control checks/Quality control checks] ✅ Success - Cache composer dependencies [Sniff stage - quality control checks/Quality control checks] ⭐ Run Set the required PHPCS and WPCS versions | ./composer.json has been updated [Sniff stage - quality control checks/Quality control checks] ✅ Success - Set the required PHPCS and WPCS versions [Sniff stage - quality control checks/Quality control checks] ⭐ Run Install the rest of the dependencies | Loading composer repositories with package information | Updating dependencies (including require-dev) | Package operations: 36 installs, 0 updates, 0 removals | - Installing squizlabs/php_codesniffer (dev-master cda358f): Cloning cda358face | Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos | Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+docker-desktop+2020-11-28+1913 | to retrieve a token. It will be stored in "/github/home/.composer/auth.json" for future use by Composer. ``` But this makes no sense since the repo is public 🤷‍♂️ How can I pass my local credentials to the container when the action is run locally?
kerem closed this issue 2026-03-01 21:42:11 +03:00
Author
Owner

@catthehacker commented on GitHub (Dec 2, 2020):

https://github.com/shivammathur/setup-php#composer-github-oauth

<!-- gh-comment-id:737040025 --> @catthehacker commented on GitHub (Dec 2, 2020): https://github.com/shivammathur/setup-php#composer-github-oauth
Author
Owner

@dingo-d commented on GitHub (Dec 2, 2020):

Thanks for that. Missed this one completely 😬

<!-- gh-comment-id:737041490 --> @dingo-d commented on GitHub (Dec 2, 2020): Thanks for that. Missed this one completely 😬
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#300
No description provided.