0

We’re developing embedded software which needs to be compiled inside an SDK container. I’m setting up a CI/CD pipeline so that we can compile, ssh-copy and ssh install it on the remote device. To make things more “thread-safe” (so that concurrent actions don’t interfere) I want to export the name of the compiled package so that I can install and clean up specifically that file on the remote device. I’ve tried normal export and an action that saves it to the “global store”, without success.

This is what I tried (all inside one job):

# Container step
         EAP=$(echo *.eap)

# Next step
      - name: Save .eap name to env
        uses: UnlyEd/github-action-store-variable@v3
        with:
          variables: |
            EAP=${{ env.EAP }}

# SSH step
        test -f $EAP

1 Answer 1

0

Solution explained in https://docs.github.com/en/github-ae@latest/actions/learn-github-actions/variables

We can use GITHUB_ENV for variables within the job, or GITHUB_OUTPUT for variables explicitly across steps and jobs. No need for separate action

Like so echo "EAP=$(echo *.eap)" >> $GITHUB_ENV

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.