Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate auto-merge for pyproject.toml update PRs #114

Merged
merged 9 commits into from
May 15, 2023
2 changes: 1 addition & 1 deletion .github/workflows/_local_ci_automerge_dependency_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
update-dependencies-branch:
name: Call reusable workflow
if: github.repository_owner == 'SINTEF' && startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]'
if: github.repository_owner == 'SINTEF' && ( ( startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]' ) || ( github.event.pull_request.head.ref == 'ci/update-pyproject' && github.actor == 'TEAM4-0' ) )
uses: ./.github/workflows/ci_automerge_prs.yml
secrets:
PAT: ${{ secrets.RELEASE_PAT }}
3 changes: 3 additions & 0 deletions docs/workflows/ci_automerge_prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ The motivation for being able to run changes prior to auto-merging, is to update
Usually auto-merging is activated for [dependabot](https://docs.github.com/en/code-security/dependabot) branches, i.e., when a dependency/requirement is updated.
Hence, the changes could include updating this dependency in documentation files or similar, where it will not be updated otherwise.

!!! note "PR branch name"
The generated branch for the PR will be named `ci/update-pyproject`.

## Expectations

The `PAT` secret must represent a user with the rights to activate auto-merging.
Expand Down
3 changes: 3 additions & 0 deletions docs/workflows/ci_update_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ The main point of having this workflow is to have a single PR, which can be squa

As a "bonus" this workflow supports updating [pre-commit](https://pre-commit.com) hooks.

!!! note "PR branch name"
The generated branch for the PR will be named `ci/update-dependencies`.

!!! warning
If a PAT is not passed through for the `PAT` secret and `GITHUB_TOKEN` is used, beware that any other CI/CD jobs that run for, e.g., pull request events, may not run since `GITHUB_TOKEN`-generated PRs are designed to not start more workflows to avoid escalation.
Hence, if it is important to run CI/CD workflows for pull requests, consider passing a PAT as a secret to this workflow represented by the `PAT` secret.
Expand Down