Skip to content

Post-run actions on multi-usage #32

Description

@chkpnt

First of all, thanks for this GH-Action :-)

I'm using this action twice in my workflow because using a ssh-agent with multiple keys doesn't seem to work with the Gradle-plugin I'm using to push some data to Git-Repositories over ssh.

[...]
      - uses: webfactory/ssh-agent@v0.3.0
        with:
          ssh-private-key: ${{ secrets.WORKFLOW_SSH_KEY }}
        continue-on-error: true
      - name: Push data, if there are any changes
        run: ./gradlew gitPublishPush --info

      - uses: webfactory/ssh-agent@v0.3.0
        with:
          ssh-private-key: ${{ secrets.WORKFLOW_SSH_KEY_ARCHIV_REPO }}
        continue-on-error: true
      - name: Archive the PDFs in a private repo
        run: ./gradlew -b archive.gradle.kts gitPublishPush --info

This works fine, but I have to use continue-on-error because otherwise, the second post-run-action (which belongs to the first ssh-agent) fails:

grafik

Can I somehow trigger the post-run action manually at an earlier step?

Otherwise, I suggest to check in cleanup.js, if the process is already killed.

execSync('kill ${SSH_AGENT_PID}', { stdio: 'inherit' })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions