Closed YOU54F closed 1 month ago
We get duplicate builds on PR's because of
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
do we need both? if we need both, if they both trigger at the same time, should it cancel one?
one build fails, one passes
https://github.com/pact-foundation/pact-php/actions/runs/2396687319 https://github.com/pact-foundation/pact-php/actions/runs/2396687271
I've never seen pull_request_target
used before. I personally prefer pull_request
. But I think there may be extra yaml that can prevent duplicate runs as well as removing. What do others think?
Logic should be that without conflicts, master
should broadly always pass; allowing push
to go away too.
pull_request_target sounds scary, there is a big wraning
it's weird it says
prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow
but then also states
unless the permissions key is specified and the workflow can access secrets, even when it is triggered from a fork.
This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows your workflow to do things like label or comment on pull requests from forks. Avoid using this event if you need to build or run code from the pull request.
Warning: For workflows that are triggered by the pull_request_target event, the GITHUB_TOKEN is granted read/write repository permission unless the permissions key is specified and the workflow can access secrets, even when it is triggered from a fork. Although the workflow runs in the context of the base of the pull request, you should make sure that you do not check out, build, or run untrusted code from the pull request with this event. Additionally, any caches share the same scope as the base branch. To help prevent cache poisoning, you should not save the cache if there is a possibility that the cache contents were altered. For more information, see "Keeping your GitHub Actions and workflows secure: Preventing pwn requests" on the GitHub Security Lab website.
I've used
on:
push:
pull_request:
branches: [main]
which means CI always runs on any push, and on pull_request
only to main
https://github.com/pactflow/pact-msw-adapter/blob/main/.github/workflows/build-and-test.yml
There is a few improvements I want to make to these workflows, a-lot of my train of thought was actually documented in here https://ncorti.com/blog/howto-github-actions-build-matrix but that doesn't the answer on the ideal workflow triggers
Developing Guide :- https://github.com/pact-foundation/pact-php/blob/ffi/DEVELOPING.md
Release notes are generated when creating a release, see releasing notes, we don't create a distinct CHANGELOG file
Going to close this off now, I think we are in a pretty happy place.
For anything else that people want actioned, we can raise as separate tickets
Hey @cfmack,
Just beginning to set up maintenance checklists against the various repos, and since I am here probably a good place to start
CHANGELOG
file generated[ ] GH actions to test/update pact ruby standalone when it is available https://github.com/pact-foundation/pact-php/blob/master/script/create-pr-to-update-pact-ruby-standalone.shI'm happy to pick most of these up over time, but just jotting them somewhere for now