2

我有以下 yaml 文件。直到昨天它工作得很好。不幸的是,从今天开始收到以下警告,然后出现以下错误。

希望有人能够指出我解决此问题的解决方案。下面是yaml代码

name: CI_dev

on:
  pull_request:
    branches: [ dev ]

jobs:
  test_pipeline:
    runs-on: ubuntu-latest
    
    steps:
    # Install Salesforce CLI
    - name: Install Salesforce CLI
      run: |
          wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
          mkdir sfdx-cli
          tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
          ./sfdx-cli/install
          
    #Checkout master
    - name: 'checkout master'
      uses: actions/checkout@master

    #read secret, authenticate and deploy
    - name: 'Populate auth file with SFDX_URL secret'
      shell: bash
      run: 'echo ${{ secrets.secret}} > ./secret.txt'

    - name: 'Authenticate'
      run: 'sfdx force:auth:sfdxurl:store --sfdxurlfile=./secret.txt -a secretAlias' 
      
    - name: 'Deploy'
      run: "sfdx force:source:deploy --sourcepath ./force-app/main/default -l RunLocalTests -u secretAlias"

以下是出现在身份验证步骤上的警告

Warning: force:auth:sfdxurl:store is not a sfdx command.
Did you mean auth:sfdxurl:store? [y/n]: 

以下是部署步骤中出现的错误

ERROR running force:source:deploy:  No org configuration found for name secretAlias
Error: Process completed with exit code 1.
4

2 回答 2

2

sfdx(至少是 linux 发行版)最近从 7.82.1 更新到 7.83.1(2021 年 1 月)

从 7.83.1 开始,它遵循不同的语法格式。您需要force:从“身份验证”命令行中删除,因为错误消息中建议您这样做。

您可以通过以下方式查看当前版本:

sfdx --version
于 2021-01-15T12:58:08.190 回答
0

忙箱是对的。只需要从 force:auth 中移除 force:auth 并且它已经再次工作。下面是更新的 yaml 文件作为参考。

name: CI_dev

on:
  pull_request:
    branches: [ dev ]

jobs:
  test_pipeline:
    runs-on: ubuntu-latest
    
    steps:
    # Install Salesforce CLI
    - name: Install Salesforce CLI
      run: |
          wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
          mkdir sfdx-cli
          tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
          ./sfdx-cli/install
          
    #Checkout master
    - name: 'checkout master'
      uses: actions/checkout@master

    #read secret, authenticate and deploy
    - name: 'Populate auth file with SFDX_URL secret'
      shell: bash
      run: 'echo ${{ secrets.secret}} > ./secret.txt'

    - name: 'Authenticate'
      run: 'sfdx auth:sfdxurl:store --sfdxurlfile=./secret.txt -a secretAlias' 
      
    - name: 'Deploy'
      run: "sfdx force:source:deploy --sourcepath ./force-app/main/default -l RunLocalTests -u secretAlias"
于 2021-01-15T14:16:51.563 回答