Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to not do post-job cleanup #1149

Open
Piedone opened this issue Jan 30, 2023 · 12 comments
Open

Option to not do post-job cleanup #1149

Piedone opened this issue Jan 30, 2023 · 12 comments

Comments

@Piedone
Copy link

Piedone commented Jan 30, 2023

The action does some cleanup in post-job (starting with the message "Post job cleanup."). I guess this is useful if the runner is reused, but I don't see the point of doing any cleanup on an ephemeral runner, that will be thrown away anyway. This is an issue because this cleanup can actually take significant time, like a minute, as you can also see in this run. This adds to the wait time of developers looking for build results, and to the bill paid for non-free runs.

So, it would be great to be able to turn this feature off.

I'm aware that the clean parameter exists, but that's for cleaning in the beginning, before fetching.

@wlgrd
Copy link

wlgrd commented Feb 14, 2023

I agree. I also have a use case where I need to debug the runner after execution and need the checked-out code to persist.

@peter-miroshnikov
Copy link

Same here, i execute other cleanups before that and it will be weird to exclude only the files checked out in order to delete them later with this action.

@AdamJudge
Copy link

We're having the post-job cleanup cause occasional errors, so yes if it's possible to disable this it would be great

@line-joonsoo
Copy link

line-joonsoo commented Aug 30, 2023

I think this is essential, because I having an issue with post-job cleanup...
Here is setup:
Runner.yml

    steps:
      - name: Checkout action scheduler
        uses: actions/checkout@v3
      - name: Schedule automerge
        uses: ./.github/runner/auto_merge_runner  # The action.yml file is contained in this path of github actions running repo

actions.yml

  steps:
    - name: Checkout Working Repo
      uses: actions/checkout@v3
      with:
        repository: 'some/repository'
        ref: feature/github_action
        token: ${{ inputs.gh_token }}
     ...
     Working steps
     ...

And then, it works well on each process steps, but fails on "Post Schedule automerge" steps:

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/xxx/xxx/_work/xxx/xxx/.github/runner/auto_merge_runner

Because, it's already checked out to "some/repository", the actions.yml file can't be found which is on original github actions running repo.
So I think it needs to reverse-checkout before doing post action, or just give options to disable post action

@snps-midhunn
Copy link

I believe this will be an important feature to have for re-using workspace across jobs. If the build artifacts are of significant size and a regression has to be run on it we can use the same workspace.

@snps-swamyt
Copy link

We also would like to have this feature, as our build artifacts are too large to be cached, and we want to use the build artifacts in the subsequent jobs.

@Kristiansmp
Copy link

We would like to have this feature also. We use kota65535/github-openvpn-connect-action to create VPN connection.
When the Post Connect to VPN is triggered, it causes the network to change (NETWORK CHANGED). Only way to control this is to Connect to VPN in earlier phase, that is "needed" --> to trigger the Post later

@langsmith
Copy link

Wild that this still hasn't been addressed 😕 Has anyone found a workaround?

@OleksandrKvl
Copy link

OleksandrKvl commented May 6, 2024

Without this functionality, it's impossible to use custom actions because of the failing "post" step.

UPDATE.
If you have an error like Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' during Post action step, just avoid overwriting/removing .github directory (or wherever you store your custom action) by your action. In my case that was caused by anactions/checkout action used inside my custom action. The solution is to use path option to avoid cloning the repo directly into the root directory.

@bsumer-wyn
Copy link

Screen Shot 2024-05-14 at 09 17 21 AM
We are having the same issue here. Not sure if there is a solution for this.

@BrendenWalker
Copy link

Another 'me too'. I'm migrating a very mess workflow that takes 3.5 hours to run. This would make incremental testing directly on self-hosted runner feasible vs. throwing changes at the wall and waiting.

@shadowprompt
Copy link

me too. I need remain some files for next step to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

14 participants