From d68654b5184db267386c84abb318f235de443ba2 Mon Sep 17 00:00:00 2001 From: Nat DeFries <42820733+nmdefries@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:42:23 -0400 Subject: [PATCH] change working dir to action user so files can be deleted Some data files from a previous run of this action are created with root as the owner. Because the action runs as a non-root user, such files are [not able to be deleted](https://github.com/cmu-delphi/forecast-eval/runs/3351290227?check_suite_focus=true) which is needed for the actions/checkout@v2 step to install the newest version of the repo. This seems to be a bug in the actions/checkout@v2 command, perhaps specific to self-hosted workflows. [Summary of issue](https://github.com/actions/runner/issues/691) and [suggested fixes[(https://github.com/actions/checkout/issues/211). --- .github/workflows/s3_upload_ec2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/s3_upload_ec2.yml b/.github/workflows/s3_upload_ec2.yml index 3ee8be7..9a6b00c 100644 --- a/.github/workflows/s3_upload_ec2.yml +++ b/.github/workflows/s3_upload_ec2.yml @@ -19,6 +19,9 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: + - name: Change dir owner to working user + run: sudo chown -R $USER:$USER $GITHUB_WORKSPACE + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2