I've 2 workflows with the names update_workflow.yml
and build.yml
. As the name states, update_workflow.yml
fetches the changes from the upstream repo and rebase my changes on top of it everyday. While the buidl.yml
builds the build depending on the changes made.
The thing here to note is that, update_workflow.yml
calls the build.yml
after the update:
update_fork:
# Here, comes all the git commands that actually updates the repo
build_now:
needs: update_fork
uses: ./.github/workflows/build.yml
secrets: inherit
I've used workflow_call:
in the build.yml
.
Everything is working fine, but the actual problem that arises is when the build.yml
is called.
It builds the build for the previous version and not the latest that update_fork.yml
updated a minute back.
What changes should I need to make to make sure that, the called workflow build.yml
is actually building the build for the latest freshly fetched update?
And yes, manually running build.yml
works fine.
One solution that I found is that to call workflow_dispatch by using cURL request that I'm not comfortable with.
Can I make slight changes to the existing repo without actually using cURL?
Edit1:
I cannot follow this method either as the output given by update_fork.yml
updates the entire repo with below given commands:
git checkout main
git rebase upstream/main || git diff
git push -f origin main
echo "Rebase successful!"
Edit2:
Yes, I've added reference
as main
on both the files.
Update_fork.yml
:
...
steps:
- name: Checkout Forked Repo
uses: actions/checkout@v3
with:
repository: repo/name
ref: main
fetch-depth: '0'
- name: Next step
...
build.yml
:
...
steps:
- uses: actions/checkout@v3
with:
repository: repo/name
ref: main
fetch-depth: '0'
...