Skip to content

How to make one workflow dependent on the other? #26907

Answered by weide-zhou
sayakpaul asked this question in Actions
Discussion options

You must be logged in to vote

Hi @sayakpaul,

So the problem is how to make sure the 2nd workflow get the latest run.txt url.
Since it’s not supported to depend pull request event on push event, you can use two jobs as a workaround(not ideal but should work).

name: test
on: [push]

jobs:
commit:
runs-on: ubuntu-latest
outputs:
string: ${{ steps.changestring.outputs.string}}
steps:
- uses: actions/checkout@v2
- name: generate new url and change to run.txt
run: |
....... # Your steps to generate new url and store to run.txt
- name: set as output
id: changestring
run: |
echo "::set-output name=string::$(<run.txt)"

PR-Comment:
runs-on: ubuntu-latest
needs: [commit]
steps:
- name: add PR issue comment
run: |
PRnumber=$(curl …

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants