From f506ef7614d84c8bfd122e94f7deeb4870ae6913 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 27 Oct 2024 21:20:31 +0100 Subject: [PATCH 1/2] dependabot: Ignore major PatternFly and sass updates Copied from our other projects. --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7159de0f3..89c86e7f7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -36,6 +36,15 @@ updates: patterns: - "@xterm/*" + ignore: + # https://github.com/cockpit-project/cockpit/issues/21151 + - dependency-name: "sass" + versions: ["1.80.x", "2.x"] + + # needs to be done in Cockpit first + - dependency-name: "@patternfly/*" + update-types: ["version-update:semver-major"] + - package-ecosystem: "github-actions" directory: "/" open-pull-requests-limit: 3 From 41e859cd859e3483d22a75de8992c3b678ebb57b Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 21 Oct 2024 11:17:13 +0200 Subject: [PATCH 2/2] workflows: teach dependabot workflow to rebase Our dependabot workflow is unable to deal with conflicting node_modules when we land one of the dependabot pull requests. The manual workflow before was to let dependabot re-create the pull request and then add the `node_modules` label after re-recreating the pull request. Automating this is tricky as a Github workflow cannot automate the recreate comment as it has no write permissions to our projects. The new approach when adding a `node_modules` label will always rebase the pull request and in case of a conflict will remove the conflicting node_modules changes in the commit. Afterwards we create the new node_modules commit which can be merged. --- .github/workflows/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 0ab897577..eecf97fa7 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -41,6 +41,18 @@ jobs: } } + - name: Rebase pull request and drop node_modules changes + run: | + set -x + git config --global user.name "GitHub Workflow" + git config --global user.email "cockpituous@cockpit-project.org" + git fetch origin main:main + if ! git rebase main; then + git reset node_modules + GIT_EDITOR=true git rebase --continue + git show --stat + fi + - name: Update node_modules for package.json changes run: | make tools/node-modules