Code Monkey home page Code Monkey logo

Comments (6)

LindaNab avatar LindaNab commented on September 21, 2024 1

Hi Peter. I had totally forgotten to reply but thank you for providing a work around! It works around the issue indeed. I've added a needs clause to prevent the second job from running until the first job is finished (https://github.com/LindaNab/me_neo/blob/master/.github/workflows/main.yml).

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

Hi @LindaNab

It does seem to have only failed on the runs that ran over 1 hour, which is very strange if it's not a coincidence. Assuming that is the case, it's possible that something in the virtual machine is timing out after 1 hour. Are you able to try using runs-on: ubuntu-latest instead of runs-on: macOS-latest to see if that makes a difference?

from create-pull-request.

LindaNab avatar LindaNab commented on September 21, 2024

Hi @peter-evans
Thanks for your reply, I've changed runs-on: macOS-latest to runs-on: ubuntu-latest but unfortunately, this didn't make a difference (i.e., the same error occurred):
https://github.com/LindaNab/me_neo/actions/runs/62822395

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

This is a very strange issue. I'll need to take some time to try and reproduce this and figure out what is going on. If something really is timing out after an hour on the Actions runner then it might be out of my control.

One possible way you could try to work around this is by separating the workflow into two jobs. The first job executes your workload and produces the output. The output is then uploaded as an artifact using the upload-artifact action. The second job checks out the repository again, downloads the artifact with download-artifact action, and then raises a pull request. Creating a "fresh job" like this might work around the issue.

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        scen_num: [0, 1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v2
      - uses: r-lib/actions/setup-r@v1
      - name: Run simulation study for scen_num ${{ matrix.scen_num }}
        run: |-
          Rscript rcode/testjob.R ${{ matrix.scen_num }} 5
      - uses: actions/upload-artifact@v1
        with:
          name: data-output-${{ matrix.scen_num }}
          path: data/output
  pullRequest:
    needs: [build]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        scen_num: [0, 1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/download-artifact@v1
        with:
          name: data-output-${{ matrix.scen_num }}
          path: data/output
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: Add sim output simulation study datagen_scen scen_num ${{ matrix.scen_num }}
          committer: Linda Nab <[email protected]>
          branch: patch${{ matrix.scen_num }}

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

Great! Glad that worked for you.

Sorry, I forgot about the needs clause. Updated the example above in case anyone has the same problem and sees this issue.

As I mentioned before, it seems likely that something is timing out or expiring in jobs on the Actions runner after 1 hour. There wouldn't be anything I could do to fix that root problem, so for now I'm going to consider this "fixed" by the workaround.

from create-pull-request.

peter-evans avatar peter-evans commented on September 21, 2024

I found these notes in the official documentation that confirm it's the GITHUB_TOKEN that expires after 60 minutes. I think this information was added fairly recently.

The installation access token expires after 60 minutes. GitHub fetches a token for each job, before the job begins.

Note: When a workflow run or its jobs are queued for more than one hour, the token may expire before the job starts.

https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret

from create-pull-request.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.