From 2aae8ff67e1ef6f868d11487524084601fb1564c Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Fri, 10 Mar 2023 13:42:28 +0100 Subject: [PATCH 1/2] Activate auto-merge for pyproject.toml update PRs --- .github/workflows/_local_ci_automerge_dependency_prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_local_ci_automerge_dependency_prs.yml b/.github/workflows/_local_ci_automerge_dependency_prs.yml index 565e327f..aabce1f9 100644 --- a/.github/workflows/_local_ci_automerge_dependency_prs.yml +++ b/.github/workflows/_local_ci_automerge_dependency_prs.yml @@ -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 }} From 5ebf008f4021d3d7a4e8adb14cd5e1b583d8e92f Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Fri, 10 Mar 2023 13:48:45 +0100 Subject: [PATCH 2/2] Add notes to docs about gen. branch names The branch names for generated branches used to open PRs was not mentioned anywhere in the documentation. This rectifies that by adding notes to the two relevant callable workflow documentation pages. --- docs/workflows/ci_automerge_prs.md | 3 +++ docs/workflows/ci_update_dependencies.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/workflows/ci_automerge_prs.md b/docs/workflows/ci_automerge_prs.md index a6bffe4f..814071ec 100644 --- a/docs/workflows/ci_automerge_prs.md +++ b/docs/workflows/ci_automerge_prs.md @@ -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. diff --git a/docs/workflows/ci_update_dependencies.md b/docs/workflows/ci_update_dependencies.md index e088f54b..d44191f7 100644 --- a/docs/workflows/ci_update_dependencies.md +++ b/docs/workflows/ci_update_dependencies.md @@ -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.