Skip to content

Commit

Permalink
Merge pull request 2i2c-org#2626 from GeorgianaElena/api_limit
Browse files Browse the repository at this point in the history
Document auto-assignement workflow and consider moving the required o…
  • Loading branch information
GeorgianaElena authored Jun 8, 2023
2 parents fb41d26 + c423336 commit e6ed378
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/auto-author-assign-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ on:
types:
- opened
- reopened
# Normally, it's enough for this workflow to be triggered only once, on PR opening/reopening.
# But because we use this workflow as a required workflow for other repositories
# in the 2i2c organization, it is **expected** to run successfully
# for each PR commit in those repositories.
# So we trigger it for each commit
- synchronize

permissions:
pull-requests: write
Expand Down
15 changes: 15 additions & 0 deletions docs/reference/ci-cd/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ GitHub's UI is slightly confusing for distinguishing between _workflows that ran

To help contributors to our `infrastructure` repository find the right workflow run, we have a GitHub Actions workflow that [posts a comment on a just merged Pull Request](https://github.com/2i2c-org/infrastructure/blob/HEAD/.github/workflows/comment-test-link-merged-pr.yaml) with a link to the GitHub Actions run of the `deploy-hubs.yaml` workflow (described in [](cicd/hub)) that the merge triggered.
Hence, it should be much easier to find the current deployments caused by merges than just following GitHub's UI.

## Required workflows and author auto-assignment

To make the most out of the [Project Boards](https://github.com/orgs/2i2c-org/projects) that 2i2c uses, the [`auto-author-assign-pull-request.yaml`](https://github.com/2i2c-org/infrastructure/blob/master/.github/workflows/auto-author-assign-pull-request.yaml) workflow automatically assigns authors to Pull Requests.

Because this is a practice that we wish to have across other 2i2c repositories, an equivalent of the `auto-author-assign-pull-request.yaml` workflow in https://github.com/2i2c-org/infrastructure exists in https://github.com/2i2c-org/.github/tree/HEAD/workflows. The workflow in the https://github.com/2i2c-org/.github repository is marked as a [required workflow](https://docs.github.com/en/actions/using-workflows/required-workflows). This means that it will run on every PR in the repositories that it's setup as required for.

```{note}
An additional, slightly different workflow than the one in https://github.com/2i2c-org/infrastructure is set up in the https://github.com/2i2c-org/.github repository
because we want to avoid adding up to [GitHub's API rate limits](https://docs.github.com/en/rest/rate-limit) for https://github.com/2i2c-org/infrastructure.
Hence, the workflow in https://github.com/2i2c-org/infrastructure, will only trigger when PRs are opened/reopened instead of every time they are updated.
This is because a _GitHub Required Workflow_ is expected to successfully run **for each commit** in that Pull Request, otherwise merging it will be **blocked**.
```

0 comments on commit e6ed378

Please sign in to comment.