Closed Juknum closed 6 months ago
@Juknum Please help to try the following guide.
on:
workflow_call:
secrets:
access-token:
description: 'A token passed from the caller workflow'
required: false
jobs:
pass-secret-to-action:
runs-on: ubuntu-latest
steps:
# passing the secret to an action
- name: Pass the received secret to an action
uses: ./.github/actions/my-action
with:
token: ${{ secrets.access-token }}
# passing the secret to a nested reusable workflow
pass-secret-to-workflow:
uses: ./.github/workflows/my-workflow
secrets:
token: ${{ secrets.access-token }}
For me it was just an issue with secrets. I forgot to add them to repository Settings.
For me it was just an issue with secrets. I forgot to add them to repository Settings.
It wasn't that for me (I checked at least 10x times aha)
I changed my workflow so I'm not concerned by the issue anymore but I'm pretty sure @appleboy provided the right answer (I did not tried it)
May I see the changed one?
i had to add the environment and it worked.
name: Deploy
on:
push:
branches:
- prod
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v4.1.7
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSHKEY }}
script: ".scripts/deploy.sh"
i had to add the environment and it worked.
name: Deploy on: push: branches: - prod jobs: deploy: runs-on: ubuntu-latest environment: prod steps: - uses: actions/checkout@v4.1.7 - name: Deploy to server uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} port: ${{ secrets.PORT }} key: ${{ secrets.SSHKEY }} script: ".scripts/deploy.sh"
For me it was also the environment!! No problems with the issue at all, but forgot to include the "environment: " tag on every step of my action
Hi, it might be intentional (I did not see anything in the README) but I was trying to use
appleboy/ssh-action@master
trough a workflow call like so (for testing purpose as this use case is a no-go aha, why would you deploy on a PR) :But the action failed (with the same error message as #19) without further explanation (I guess something doesn't get passed trough the call)
Whereas using it directly on a push change event does work as expected: