* Remove rebase workflow as it will not work as expected with third party forks.
* Add the create_buildkite_pr_build.sh script.
This script will use the GitHub API to gather information about the PR, the PR
Author and create a Pull Request pipeline build on Buildkite.
You can mock out the things needed to work on this script locally with the
following environment variables exported:
export BUILDKITE_API_ACCESS_TOKEN=notarealtoken
export GITHUB_EVENT_PATH=$(curl --silent 2d0e0bdefc/github_actions_event_context.json)
export GITHUB_REPOSITORY=forem/forem
export GITHUB_TOKEN=notarealtoken
Note: You will need to get your own BUILDKITE_API_ACCESS_TOKEN and GITHUB_TOKEN
tokens.
You can then run the script locally to create builds from a pull request. The
GITHUB_EVENT_PATH JSON data is from https://github.com/forem/forem/pull/1181
which might not build on Buildkite down the road if is is closed. You might need
to pull down that JSON data and find and replace the PR number 11818 with thing
else.
Also this script could be busted out into it's own GitHub Action repo so you can
work on it outside of the Forem repo, but I don't have the mental fortitude to
work on GitHub Actions at this time. It is the most painful CI systems I have used
to date in terms of having an very very poor feedback loop/developer experience.
It desperately needs a REPL or mock shell for you to develop actions in so you don't
have to keep submitting PRs to your main branch to see results.
This should be the last PR to get the `/ci` and `/rebase` commands working in
GitHub Actions. The issue is that our membership settings for `forem/forem` have
everyone set to 'CONTRIBUTOR' instead of 'MEMBER' or 'OWNER'.
Adding github.event.comment.author_association == 'CONTRIBUTOR' should fix this
issue.
I also cleaned up all action files to make the main name of the workflow as
succinct as possible to better organize the left menut of the GitHub Actions
page.
This PR won't fix the issues with the "Run forem/build-containers pipeline"
job in buildkite.yml but I will address those issues in another PR.
* Update if statement w/r/t github.event.issue.pull_request conditional and update
cirrus-actions/rebase to 1.4.
* Fix running the PR comment workflow so it only runs if
github.event.pull_request.head.repo.full_name != github.repository
How neat!
* GitHub workflow for /ci trigger
Add in GitHub workflow for adding the `ci` label to the PR and running Buildkite
pipeline(s).
The `ci` label will allow the PR to be built on push without havinvg to continuously
issue the `/ci` trigger from a Forem team member.
```
build.pull_request.repository.fork != true || build.pull_request.labels includes "ci"
```
Also using the `/ci` trigger will run the initial pipeline builds too.
* Fix YAML formatting and typos.
* Add note to PR template.
* Conditionally add a comment to a new PR when it originates from a third-party
fork with a note about having to wait for manual approval for our CI to run on
their PR.
* Update .github/PULL_REQUEST_TEMPLATE.md
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update .github/workflows/pr.yml
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Adjust if statement to include OWNERS and do startsWith instead of contains.
Co-authored-by: Michael Kohl <citizen428@dev.to>