From c02776c1bf203222cd3a5295280b2f18899f2b3b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 28 Jul 2023 16:18:03 +0200 Subject: [PATCH] feat(ci): upload components with --dry-run in PRs --- .github/workflows/upload_component.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/upload_component.yml b/.github/workflows/upload_component.yml index 00ae7ec2ee..1ae2bf2ac0 100644 --- a/.github/workflows/upload_component.yml +++ b/.github/workflows/upload_component.yml @@ -1,6 +1,11 @@ name: Push components to Espressif Component Service on: + # For pull requests: perform upload with "--dry-run" argument, + # i.e. validate that the component passes all checks for being uploaded. + pull_request: + + # For pushes to master: actually upload the components to the registry. push: branches: - master @@ -12,6 +17,8 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + - run: | + echo "${{ github.ref_name != 'master' && 'Checking' || 'Uploading' }} components" - name: Upload components to component service uses: espressif/upload-components-ci-action@v1 with: @@ -65,4 +72,7 @@ jobs: zlib; libpng; namespace: "espressif" + # API token will only be available in the master branch. + # However, dry-run doesn't require a valid token. api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} + dry_run: ${{ github.ref_name != 'master' }}