Two people update a weekly report in quick succession. Both runs of the GitHub workflow can write to the same preview location. Put the job that does the writing in one concurrency group, while ordinary checks can run independently. Use a name reserved for this preview target, such as weekly-report-preview-publish, so the job and any other writer to the same target can use the same group deliberately.

concurrency:
  group: weekly-report-preview-publish
  cancel-in-progress: false

Put this at job level if publishing is the only step that needs exclusive access. The default keeps at most one run pending. If a third job enters the group while the first runs, the third can replace the second in that waiting slot. That can suit an overwriteable preview. A workflow in which each update has to run needs a queue or separate destinations.

Try three manual runs with a disposable destination and a short pause before publishing. Check that only one publishing job runs at a time and that the expected run eventually publishes. If the destination loses files during replacement, concurrency alone cannot fix that. Test how the publishing step behaves if it exits halfway through.

Use the destination as the unit of locking

Make runs A, B and C publish a file carrying their run label. Start A, wait until it reaches the publishing job, then start B and C while A is still working. With the default queue, expect B to be replaced if it was already pending when C joined. After the jobs settle, check the surviving report label and the timestamps for any overlap.

If each report must be published, GitHub’s queue: max allows up to 100 jobs to wait and requires cancel-in-progress to stay false or omitted. Keep the same group for every workflow writing to this target within the repository. Check for other writers outside that group before relying on the result.

Sources