Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longer secret string throws error #117

Closed
Steffen911 opened this issue Mar 2, 2020 · 0 comments · Fixed by #118
Closed

Longer secret string throws error #117

Steffen911 opened this issue Mar 2, 2020 · 0 comments · Fixed by #118

Comments

@Steffen911
Copy link
Contributor

What happened:
I use an .actrc file to provide the target docker image and a secret that corresponds to an inlined maven settings.xml file.
Now, when I run act I get Error: accepts at most 1 arg(s), received 64.

My .actrc:

-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04
-s SETTINGS_XML='<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <servers> <server> <id>backend-s3-release-repo</id> <username><USERNAME></username> <password><PASSWORD></password> </server> <server> <id>backend-s3-snapshot-repo</id> <username><USERNAME></username> <password><PASSWORD></password> </server> </servers> </settings>'

I tried to assign the value with single quotes, double quotes (with escaping the inner quotes) and without any quotes add all. The error is always the same.

When I pass the secret via the environment everything works fine and change the .actrc file to

-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04
-s SETTINGS_XML

everything works as expected.

What I expect to happen:
It should run the workflow with the given settings.xml as the secret.

Version/Platform:
act version 0.2.4
macOS 10.15.3
command: act
output: Error: accepts at most 1 arg(s), received 64

workflow:

name: PR Build
on: [pull_request]
jobs:
  build:
    name: Build and Run Tests
    runs-on: ubuntu-18.04
    steps:
      - name: Checkout Code
        uses: actions/checkout@v1
      - name: Build and Run Tests
        run: |
          echo $SETTINGS_XML > ./settings.xml
          mvn verify --settings ./settings.xml --batch-mode
        env:
          SETTINGS_XML: ${{ secrets.SETTINGS_XML }}
@cplee cplee closed this as completed in #118 Mar 2, 2020
cplee added a commit that referenced this issue Mar 2, 2020
* fix #117 - handle whitespace in actrc secrets

* Switch to raw string on regex pattern

Co-authored-by: Casey Lee <cplee@nektos.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant