Search code examples
continuous-integrationgithub-actionstestflightfastlane

When multiple workflows run simultaneously in Git Action, can I make them run one at a time?


I'm building CI/CD using Git Action (uploading to TestFlight) I designed the logic of using FastLane to bring the latest build number and then + 1.

The problem occurs with the latest Build Number when multiple workflow runs simultaneously.

This is because multiple workflows import the same number from TestFlight before the latest Build number is updated.

To do this, I want workflow to run one at a time.

Is there a way?


Solution

  • You can use Consecutive Workflow Action

    jobs:
      consecutiveness:
        runs-on: ubuntu-latest
        steps:
        - uses: mktcode/consecutive-workflow-action@e2e008186aa210faacd68ec30f6ac236f7e2f435
          with:
            token: ${{ secrets.GITHUB_TOKEN }}
    
      # your other jobs
      something:
        runs-on: ubuntu-latest
        needs: [ consecutiveness ]
        steps:
        # ...
    

    GITHUB_TOKEN is needed to avoid rate limitation issues when performing API calls (to check the previous workflow run). Make sure you read the security note in the repository’s Readme.