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

Enable updates for GitHub Actions on stable #2352

Merged
merged 1 commit into from
May 16, 2024

Conversation

matrss
Copy link
Collaborator

@matrss matrss commented May 14, 2024

Purpose of PR?:

Fixes #2339.

Does this PR introduce a breaking change?

No.

If the changes in this PR are manually verified, list down the scenarios covered::

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes

Checklist:

  • Bug fix. Fixes #
  • New feature (Non-API breaking changes that adds functionality)
  • PR Title follows the convention of <type>: <subject>
  • Commit has unit tests

@matrss matrss requested review from ReimarBauer and joernu76 May 14, 2024 10:23
@@ -1,6 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
- &github-actions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ist das &github-actions und <<: *github-actions nur für die Beschreibung, dass dies ein Block ist, oder hat das noch eine andere Funktion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das &github-actions ist in yaml ein sogenannter "anchor", das *github-actions ist ein "alias", und <<: ist die "map merging" Syntax. Mit einem alias kann man einen anchor referenzieren, um den Inhalt des anchors wiederzuverwenden. Das map merging fügt den Inhalt des dort angegebenen Werts auf der selben Ebene ein.

Konkret bedeutet das hier: updates: ist eine Liste mit zwei Elementen. Das erste Element ist ganz gewöhnlich angegeben, hat nur zusätzlich den Namen "github-actions". Das zweite Listenelement nutzt <<: um den Inhalt von "github-actions" an dieser Stelle wiederzuverwenden. Anschließend wird nur der target-branch überschrieben.

Das ist soweit ich weiß die einzige Möglichkeit, an der Stelle Duplizierung zu vermeiden.


The &github-actions is a yaml "anchor", *github-actions is an "alias", and <<: is the "map merging" syntax. An anchor is used to give an element a name which can then be reused in other places with an alias, while the map merging merges the values that are supplied into the location where it is specified.

In this case, updates: is a list with two elements. The first one is specified as usual, but also has a name "github-actions". The second element applies <<: to reuse everything from the first (via the alias) and then additionally sets target-branch.

This is AFAIK the only way to avoid duplication in yaml.

@matrss matrss merged commit c49ff5a into Open-MSS:develop May 16, 2024
10 checks passed
@matrss matrss deleted the enable-dependabot-for-stable branch May 16, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable dependabot for the stable branch
2 participants