This repository was archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
.github: auto-merge PRs of Kernel and ca-certificates #2534
Draft
dongsupark
wants to merge
3
commits into
main
Choose a base branch
from
dongsu/github-actions-auto-merge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
- name: Figure out branch | ||
id: figure-out-branch | ||
run: .github/workflows/figure-out-branch.sh '${{ matrix.branch }}' | ||
|
@@ -42,14 +42,23 @@ jobs: | |
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} | ||
run: .github/workflows/cacerts-apply-patch.sh | ||
- name: Create pull request | ||
id: cpr | ||
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1) | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
base: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
branch: ${{ steps.apply-patch.outputs.BRANCH_NAME }} | ||
delete-branch: true | ||
author: Flatcar Buildbot <[email protected]> | ||
committer: Flatcar Buildbot <[email protected]> | ||
title: Upgrade ca-certificates in ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.NSS_VERSION }} | ||
body: Subject says it all. | ||
labels: ${{ steps.figure-out-branch.outputs.LABEL }} | ||
- name: Enable Pull Request Automerge | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
uses: peter-evans/enable-pull-request-automerge@v2 | ||
with: | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: ci-check | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci-check: | ||
name: ci-check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ci-check | ||
shell: bash | ||
working-directory: ${{ github.workspace }} | ||
run: /bin/true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
- name: Figure out branch | ||
id: figure-out-branch | ||
run: .github/workflows/figure-out-branch.sh '${{ matrix.branch }}' | ||
|
@@ -42,20 +42,30 @@ jobs: | |
env: | ||
TARGET: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
BASE_BRANCH: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
CHANNEL: ${{ matrix.branch }} | ||
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} | ||
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }} | ||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} | ||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} | ||
run: .github/workflows/kernel-apply-patch.sh | ||
- name: Create pull request | ||
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1) | ||
id: cpr | ||
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1) && (steps.apply-patch.outputs.AUTOMERGEABLE == 1) | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
base: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
branch: ${{ steps.apply-patch.outputs.BRANCH_NAME }} | ||
delete-branch: true | ||
author: Flatcar Buildbot <[email protected]> | ||
committer: Flatcar Buildbot <[email protected]> | ||
title: Upgrade Linux Kernel for ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }} | ||
body: Subject says it all. | ||
labels: ${{ steps.figure-out-branch.outputs.LABEL }} | ||
- name: Enable Pull Request Automerge | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, we need a way to stop this from happening if we can't update for whatever reason |
||
uses: peter-evans/enable-pull-request-automerge@v2 | ||
with: | ||
token: ${{ secrets.AUTOMERGE_TOKEN }} | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: merge |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a way to stop the auto merging because it could lead to breaking all builds all the time. For that I think it would be good enough to have a delay of ~30 minutes before the auto merge, and then a check whether a 'on-hold' label is present on the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could require the PRs to pass a GH actions CI build / test; automation for
scripts
should be ready in a few days, and we could add automation forcoreos-overlay
right after that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, that's what I would like to achieve. For example, create 2 different workflows,
merge-autolabel-kernel
, which reacts on PR events to actually merge the PR, andautolabel-kernel
which periodically gives a label 'automerge` to every open PR, daily ~4pm. In theory that sounds like a good idea. In practice, however it was not so trivial for the latter workflow to get actually a PR number, after create-pull-request all finished. That's where I gave up. Let me do other experiments about that.