Uh oh!
There was an error while loading. Please reload this page.
Revert "Include changes to the target branch when action is re-run" - #60
Conversation
simonjbeaumont
commented
Nov 7, 2024
simonjbeaumont
commented
Nov 7, 2024
Thanks for merging promptly. I'm finished for today now but I think we could investigate using a conditional here on the |
ahoppen
commented
Nov 7, 2024
Sorry for breaking the If you have an example of how you guard behavior on the CI environment, I’d be interested to see that and check if we can apply it here as well. |
@ahoppen Looks like we can use jobs:
foo:
runs-on: ubuntu-latestname: Foosteps:
- name: Dump envrun: env | sort
- name: Echo alwaysrun: echo "always"
- name: Echo only if FOO=trueif: env.FOO == 'true'run: echo "job running with FOO set to true"
- name: Echo only if not FOO=trueif: env.FOO != 'true'run: echo "job not running with FOO set to true"
- name: Echo only if running with actif: env.ACT == 'true'run: echo "job running with ACT"
- name: Echo only if not running with actif: env.ACT != 'true'run: echo "job not running with act"% act -j foo [PR/Foo] ✅ Success - Main Dump env[PR/Foo] ⭐ Run Main Echo always[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir=| always[PR/Foo] ✅ Success - Main Echo always[PR/Foo] ⭐ Run Main Echo only if not FOO=true[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir=| job not running with FOO set to true[PR/Foo] ✅ Success - Main Echo only if not FOO=true[PR/Foo] ⭐ Run Main Echo only if running with act[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir=| job running with ACT[PR/Foo] ✅ Success - Main Echo only if running with act[PR/Foo] Cleaning up container for job Foo[PR/Foo] 🏁 Job succeeded
% act -j foo --env FOO=false[PR/Foo] ✅ Success - Main Dump env[PR/Foo] ⭐ Run Main Echo always[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir=| always[PR/Foo] ✅ Success - Main Echo always[PR/Foo] ⭐ Run Main Echo only if not FOO=true[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir=| job not running with FOO set to true[PR/Foo] ✅ Success - Main Echo only if not FOO=true[PR/Foo] ⭐ Run Main Echo only if running with act[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir=| job running with ACT[PR/Foo] ✅ Success - Main Echo only if running with act[PR/Foo] Cleaning up container for job Foo[PR/Foo] 🏁 Job succeeded
% act -j foo --env FOO=true[PR/Foo] ✅ Success - Main Dump env[PR/Foo] ⭐ Run Main Echo always[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir=| always[PR/Foo] ✅ Success - Main Echo always[PR/Foo] ⭐ Run Main Echo only if FOO=true[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir=| job running with FOO set to true[PR/Foo] ✅ Success - Main Echo only if FOO=true[PR/Foo] ⭐ Run Main Echo only if running with act[PR/Foo] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir=| job running with ACT[PR/Foo] ✅ Success - Main Echo only if running with act[PR/Foo] Cleaning up container for job Foo[PR/Foo] 🏁 Job succeededSo I think it will just be adding |
Reverts #58
This has resulted in a destructive outcome for developers using
actto run the workflows locally, which is also in our public documentation now, particularly when used with--bind.This patch recreates the entire repo and force updates to a ref. It literally deleted my Git repo and left me with a grafted shallow clone. It discarded all my local branches and no reflog was available.
We need to revert this one quickly.
I've verified that the revert mitigates the problem by making this change in my YAMLs locally, to the commit before this PR was merged:
I'm sympathetic to the motivation behind the PR but I think we should revert immediately to avoid others hitting this.