Skip to content

Can't overwrite files on the branch with the action #390

@illright

Description

@illright

Describe the bug

My CI is set up to deploy pull requests to separate folders to allow previewing changes. I've run into an issue while trying to push subsequent commits onto a pull request branch that has already been deployed.

On the Prepare publishing assets step (this line of code) it is trying to copy the assets over the previously existing ones, and even though force is set to true while copying, it still fails with EEXIST: file already exists.

This failure is (probably mistakenly) treated as a failure to check out a branch, which causes the action to try and create a new branch, which doesn't work because the branch, in fact, exists.

To Reproduce

  1. Set up deploying on pull requests (workflow file here)
  2. Create a pull request and let it deploy
  3. Push more commits to the same branch

Expected behavior

The action should empty out the directory that stores files for this PR, then freshly copy over the new assets

Your YAML file

https://github.com/illright/attractions/blob/develop/.github/workflows/pr_demo.yml

Additional context

Here's the link to the failed job logs:
https://github.com/illright/attractions/runs/857251843?check_suite_focus=true

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions