Open nazikus opened 21 hours ago
By default, GitHub Actions does not pass secrets to reusable workflows.
In your .github/workflows/build.yml
, do this:
tests:
needs:
- build
uses: ./.github/workflows/tests.yml
secrets: inherit
And then it should work.
Or if you want to pass secret explicitly:
tests:
needs:
- build
uses: ./.github/workflows/tests.yml
secrets:
RCLONE_CONFIG: ${{ secrets.RCLONE_CONFIG }}
And then in your .github/workflows/tests.yml
:
on:
workflow_call:
secrets:
RCLONE_CONFIG:
required: true
I have two workflows (build and test) where rclone is used, first workflow executes correctly, then the second workflow is called and there rclone with exact same setup fails:
The data is there, path is correct.
rclone.conf
```ini [dataset] type = drive scope = drive.readonly team_drive = *** service_account_file = $RCLONE_CONFIG_DIR/rclone-sa.json [dist] type = drive scope = drive.readonly team_drive = *** service_account_file = $RCLONE_CONFIG_DIR/rclone-sa.json ```.github/workflows/build.yml
```yaml name: Build on: pull_request: jobs: build: runs-on: ubuntu-latest permissions: contents: read packages: write id-token: write steps: - name: Checkout code uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Setup rclone uses: AnimMouse/setup-rclone@v1 with: rclone_config: ${{ secrets.RCLONE_CONFIG }} token: ${{ secrets.GITHUB_TOKEN }} - name: Add rclone service account uses: AnimMouse/setup-rclone/service-account-file@v1 with: service_account_filename: rclone-sa.json service_account_file: ${{ secrets.SERVICE_ACCOUNT_FILE }} - name: Download packages run: rclone --verbose copy dist:packages/ packages/ tests: needs: - build uses: ./.github/workflows/tests.yml ```.github/workflows/tests.yml`
```yaml name: Tests on: workflow_call: jobs: smoke: runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read packages: write id-token: write steps: - name: Checkout code uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Setup rclone uses: AnimMouse/setup-rclone@v1 with: rclone_config: ${{ secrets.RCLONE_CONFIG }} token: ${{ secrets.GITHUB_TOKEN }} - name: Add rclone service account uses: AnimMouse/setup-rclone/service-account-file@v1 with: service_account_filename: rclone-sa.json service_account_file: ${{ secrets.SERVICE_ACCOUNT_FILE }} - name: Download test video run: rclone --verbose copy dataset:videos/2023_06_02.mp4 videos/ ```build log
2024-11-22T22:17:23.5071821Z Current runner version: '2.320.0' 2024-11-22T22:17:23.5100982Z ##[group]Operating System 2024-11-22T22:17:23.5101664Z Ubuntu 2024-11-22T22:17:23.5102125Z 22.04.5 2024-11-22T22:17:23.5102473Z LTS 2024-11-22T22:17:23.5102812Z ##[endgroup] 2024-11-22T22:17:23.5103270Z ##[group]Runner Image 2024-11-22T22:17:23.5103737Z Image: ubuntu-22.04 2024-11-22T22:17:23.5104147Z Version: 20241117.1.0 2024-11-22T22:17:23.5105179Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241117.1/images/ubuntu/Ubuntu2204-Readme.md 2024-11-22T22:17:23.5106660Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241117.1 2024-11-22T22:17:23.5107534Z ##[endgroup] 2024-11-22T22:17:23.5108016Z ##[group]Runner Image Provisioner 2024-11-22T22:17:23.5108506Z 2.0.385.1 2024-11-22T22:17:23.5108914Z ##[endgroup] 2024-11-22T22:17:23.5123649Z ##[group]GITHUB_TOKEN Permissions 2024-11-22T22:17:23.5125425Z Contents: read 2024-11-22T22:17:23.5125861Z Metadata: read 2024-11-22T22:17:23.5126542Z Packages: write 2024-11-22T22:17:23.5127080Z ##[endgroup] 2024-11-22T22:17:23.5130175Z Secret source: Actions 2024-11-22T22:17:23.5130776Z Prepare workflow directory 2024-11-22T22:17:23.5763014Z Prepare all required actions 2024-11-22T22:17:23.5927165Z Getting action download info 2024-11-22T22:17:23.9014828Z Download action repository 'actions/checkout@v4' (SHA:11bd71901bbe5b1630ceea73d27597364c9af683) 2024-11-22T22:17:24.0415360Z Download action repository 'docker/login-action@v3' (SHA:9780b0c442fbb1117ed29e0efdff1e18412f7567) 2024-11-22T22:17:24.6518380Z Download action repository 'AnimMouse/setup-rclone@v1' (SHA:e4c62ff5f942e489edceaffb563832d970253322) 2024-11-22T22:17:25.2026348Z Getting action download info 2024-11-22T22:17:25.3924201Z Download action repository 'actions/cache@v4' (SHA:6849a6489940f00c2f30c0fb92c6274307ccb58a) 2024-11-22T22:17:25.4961152Z Download action repository 'AnimMouse/tool-cache@v1' (SHA:5c73a08045bdef61c81a6c60d208cff7ab36f3aa) 2024-11-22T22:17:26.1938862Z Complete job name: build-app-image 2024-11-22T22:17:26.2819179Z ##[group]Run actions/checkout@v4 2024-11-22T22:17:26.2819736Z with: 2024-11-22T22:17:26.2820112Z repository: evisiondynamics/geo-tracker 2024-11-22T22:17:26.2820788Z token: *** 2024-11-22T22:17:26.2821212Z ssh-strict: true 2024-11-22T22:17:26.2821574Z ssh-user: git 2024-11-22T22:17:26.2821946Z persist-credentials: true 2024-11-22T22:17:26.2822418Z clean: true 2024-11-22T22:17:26.2822796Z sparse-checkout-cone-mode: true 2024-11-22T22:17:26.2823199Z fetch-depth: 1 2024-11-22T22:17:26.2823590Z fetch-tags: false 2024-11-22T22:17:26.2823914Z show-progress: true 2024-11-22T22:17:26.2824253Z lfs: false 2024-11-22T22:17:26.2824646Z submodules: false 2024-11-22T22:17:26.2825014Z set-safe-directory: true 2024-11-22T22:17:26.2825458Z ##[endgroup] 2024-11-22T22:17:26.5279177Z Syncing repository: evisiondynamics/geo-tracker 2024-11-22T22:17:26.5281458Z ##[group]Getting Git version info 2024-11-22T22:17:26.5282735Z Working directory is '/home/runner/work/geo-tracker/geo-tracker' 2024-11-22T22:17:26.5284156Z [command]/usr/bin/git version 2024-11-22T22:17:26.5383570Z git version 2.47.0 2024-11-22T22:17:26.5424155Z ##[endgroup] 2024-11-22T22:17:26.5458042Z Temporarily overriding HOME='/home/runner/work/_temp/c120e1ed-7f3d-4639-9eb0-96f1938268c2' before making global git config changes 2024-11-22T22:17:26.5463940Z Adding repository directory to the temporary git global config as a safe directory 2024-11-22T22:17:26.5465596Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/geo-tracker/geo-tracker 2024-11-22T22:17:26.5501441Z Deleting the contents of '/home/runner/work/geo-tracker/geo-tracker' 2024-11-22T22:17:26.5506248Z ##[group]Initializing the repository 2024-11-22T22:17:26.5511926Z [command]/usr/bin/git init /home/runner/work/geo-tracker/geo-tracker 2024-11-22T22:17:26.5611469Z hint: Using 'master' as the name for the initial branch. This default branch name 2024-11-22T22:17:26.5613462Z hint: is subject to change. To configure the initial branch name to use in all 2024-11-22T22:17:26.5615873Z hint: of your new repositories, which will suppress this warning, call: 2024-11-22T22:17:26.5759061Z hint: 2024-11-22T22:17:26.5760530Z hint: git config --global init.defaultBranchtests log
2024-11-22T22:17:56.1534662Z Current runner version: '2.320.0' 2024-11-22T22:17:56.1567195Z ##[group]Operating System 2024-11-22T22:17:56.1568385Z Ubuntu 2024-11-22T22:17:56.1569012Z 22.04.5 2024-11-22T22:17:56.1569627Z LTS 2024-11-22T22:17:56.1570351Z ##[endgroup] 2024-11-22T22:17:56.1570955Z ##[group]Runner Image 2024-11-22T22:17:56.1571660Z Image: ubuntu-22.04 2024-11-22T22:17:56.1572464Z Version: 20241117.1.0 2024-11-22T22:17:56.1573991Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241117.1/images/ubuntu/Ubuntu2204-Readme.md 2024-11-22T22:17:56.1576224Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241117.1 2024-11-22T22:17:56.1577726Z ##[endgroup] 2024-11-22T22:17:56.1578432Z ##[group]Runner Image Provisioner 2024-11-22T22:17:56.1579317Z 2.0.384.1 2024-11-22T22:17:56.1580151Z ##[endgroup] 2024-11-22T22:17:56.1601364Z ##[group]GITHUB_TOKEN Permissions 2024-11-22T22:17:56.1603728Z Contents: read 2024-11-22T22:17:56.1604365Z Metadata: read 2024-11-22T22:17:56.1605411Z Packages: write 2024-11-22T22:17:56.1606185Z ##[endgroup] 2024-11-22T22:17:56.1610432Z Secret source: Actions 2024-11-22T22:17:56.1611437Z Prepare workflow directory 2024-11-22T22:17:56.2549614Z Prepare all required actions 2024-11-22T22:17:56.2791565Z Getting action download info 2024-11-22T22:17:56.5157270Z Download action repository 'actions/checkout@v4' (SHA:11bd71901bbe5b1630ceea73d27597364c9af683) 2024-11-22T22:17:56.6328228Z Download action repository 'docker/login-action@v3' (SHA:9780b0c442fbb1117ed29e0efdff1e18412f7567) 2024-11-22T22:17:56.9519423Z Download action repository 'AnimMouse/setup-rclone@v1' (SHA:e4c62ff5f942e489edceaffb563832d970253322) 2024-11-22T22:17:57.0944049Z Download action repository 'mikefarah/yq@v4.43.1' (SHA:c35ec752e38ea0c096d3c44e13cfc0797ac394d8) 2024-11-22T22:17:57.6232076Z Getting action download info 2024-11-22T22:17:57.7551907Z Download action repository 'actions/cache@v4' (SHA:6849a6489940f00c2f30c0fb92c6274307ccb58a) 2024-11-22T22:17:57.9067613Z Download action repository 'AnimMouse/tool-cache@v1' (SHA:5c73a08045bdef61c81a6c60d208cff7ab36f3aa) 2024-11-22T22:17:58.1776361Z Uses: evisiondynamics/geo-tracker/.github/workflows/tests.yml@refs/pull/326/merge (2c344e13b222aef3a4a042be281f4e8308be58e8) 2024-11-22T22:17:58.1778270Z Complete job name: tests / smoke 2024-11-22T22:17:58.2346425Z ##[group]Pull down action image 'mikefarah/yq:4-githubaction' 2024-11-22T22:17:58.2431529Z ##[command]/usr/bin/docker pull mikefarah/yq:4-githubaction 2024-11-22T22:17:58.5697362Z 4-githubaction: Pulling from mikefarah/yq 2024-11-22T22:17:58.6479570Z da9db072f522: Already exists 2024-11-22T22:17:58.6506390Z fe6d8c7d0102: Pulling fs layer 2024-11-22T22:17:58.6507242Z 8bf8a8cfc183: Pulling fs layer 2024-11-22T22:17:58.6507691Z 9ff50715e852: Pulling fs layer 2024-11-22T22:17:58.6510957Z dda8c3df471c: Pulling fs layer 2024-11-22T22:17:58.6511692Z ef40521c75a6: Pulling fs layer 2024-11-22T22:17:58.6512271Z dda8c3df471c: Waiting 2024-11-22T22:17:58.6512967Z ef40521c75a6: Waiting 2024-11-22T22:17:58.7721302Z 9ff50715e852: Verifying Checksum 2024-11-22T22:17:58.7723159Z 9ff50715e852: Download complete 2024-11-22T22:17:58.7838896Z 8bf8a8cfc183: Verifying Checksum 2024-11-22T22:17:58.7840065Z 8bf8a8cfc183: Download complete 2024-11-22T22:17:58.8104161Z fe6d8c7d0102: Verifying Checksum 2024-11-22T22:17:58.8105422Z fe6d8c7d0102: Download complete 2024-11-22T22:17:58.8587164Z ef40521c75a6: Verifying Checksum 2024-11-22T22:17:58.8588485Z ef40521c75a6: Download complete 2024-11-22T22:17:58.8640476Z dda8c3df471c: Verifying Checksum 2024-11-22T22:17:58.8641468Z dda8c3df471c: Download complete 2024-11-22T22:17:59.0183634Z fe6d8c7d0102: Pull complete 2024-11-22T22:17:59.0342932Z 8bf8a8cfc183: Pull complete 2024-11-22T22:17:59.0514383Z 9ff50715e852: Pull complete 2024-11-22T22:17:59.0730705Z dda8c3df471c: Pull complete 2024-11-22T22:17:59.0857750Z ef40521c75a6: Pull complete 2024-11-22T22:17:59.0920562Z Digest: sha256:c961355bdf78bc20830bd7f2440e7171c3ab9074489b4ba0dabcd10b845d1239 2024-11-22T22:17:59.0925220Z Status: Downloaded newer image for mikefarah/yq:4-githubaction 2024-11-22T22:17:59.0926461Z docker.io/mikefarah/yq:4-githubaction 2024-11-22T22:17:59.0947741Z ##[endgroup] 2024-11-22T22:17:59.1531377Z ##[group]Run actions/checkout@v4 2024-11-22T22:17:59.1532010Z with: 2024-11-22T22:17:59.1532738Z repository: evisiondynamics/geo-tracker 2024-11-22T22:17:59.1533681Z token: *** 2024-11-22T22:17:59.1534166Z ssh-strict: true 2024-11-22T22:17:59.1534829Z ssh-user: git 2024-11-22T22:17:59.1535403Z persist-credentials: true 2024-11-22T22:17:59.1535984Z clean: true 2024-11-22T22:17:59.1536627Z sparse-checkout-cone-mode: true 2024-11-22T22:17:59.1537290Z fetch-depth: 1 2024-11-22T22:17:59.1537783Z fetch-tags: false 2024-11-22T22:17:59.1538418Z show-progress: true 2024-11-22T22:17:59.1538965Z lfs: false 2024-11-22T22:17:59.1539393Z submodules: false 2024-11-22T22:17:59.1540040Z set-safe-directory: true 2024-11-22T22:17:59.1540612Z ##[endgroup] 2024-11-22T22:17:59.3694206Z Syncing repository: evisiondynamics/geo-tracker 2024-11-22T22:17:59.3695879Z ##[group]Getting Git version info 2024-11-22T22:17:59.3696785Z Working directory is '/home/runner/work/geo-tracker/geo-tracker' 2024-11-22T22:17:59.3697931Z [command]/usr/bin/git version 2024-11-22T22:17:59.3754412Z git version 2.47.0 2024-11-22T22:17:59.3780512Z ##[endgroup] 2024-11-22T22:17:59.3806238Z Temporarily overriding HOME='/home/runner/work/_temp/83533dca-40a1-4e50-ad7e-fbfb6ea261a6' before making global git config changes 2024-11-22T22:17:59.3808662Z Adding repository directory to the temporary git global config as a safe directory 2024-11-22T22:17:59.3813794Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/geo-tracker/geo-tracker 2024-11-22T22:17:59.3852188Z Deleting the contents of '/home/runner/work/geo-tracker/geo-tracker' 2024-11-22T22:17:59.3856292Z ##[group]Initializing the repository 2024-11-22T22:17:59.3861507Z [command]/usr/bin/git init /home/runner/work/geo-tracker/geo-tracker 2024-11-22T22:17:59.3922371Z hint: Using 'master' as the name for the initial branch. This default branch name 2024-11-22T22:17:59.3924196Z hint: is subject to change. To configure the initial branch name to use in all 2024-11-22T22:17:59.3926074Z hint: of your new repositories, which will suppress this warning, call: 2024-11-22T22:17:59.3927341Z hint: 2024-11-22T22:17:59.3928257Z hint: git config --global init.defaultBranchWhat I've noticed in logs,
rclone_config: ***
in build job is filled andrclone_config:
in tests job is empty, but I'm struggling to understand why. Any help appreciated. Thank you