Skip to content

Conversation

loispostula
Copy link
Contributor

@loispostula loispostula commented Jan 8, 2025

Fix #3507
Introduce a key argument for github release to get the tag hash instead of the tag name.

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

This pr introduces the following changes:

  • githubrelease now supports an key argument like gittag that can either be name (default) or hash.

  • gitbranch now supports an key argument like gittag that can either be name (default) or hash.

  • yaml now accept a comment arg, when used in a target and with the yamlpath engine, it can be used to add a comment to a line.

    Yaml comment

    Given the following test.yaml

    ---
    owner: anakin

    Running updatecli.yaml

    ---
    sources:
      default:
        kind: shell
        spec:
          command: echo "obiwan"
      comment:
        kind: shell
        spec:
          command: echo "is the best"
    targets:
      default:
        kind: yaml
        sourceid: default
        spec:
          engine: yamlpath
          key: owner
          file: test.yaml
          comment: '{{ source "comment" }}'

    Would yield test.yaml

    ---
    owner: obiwan # is the best
  • githubaction autodiscovery can be setup to resolved digest:

jobs:
  build:
    steps:
      - uses: "actions/checkout@v4`

gets resolved to

jobs:
  build:
    steps:
      - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"  # pinned from v4.2.2 by updatecli (do-not-remove-comment)`

The comment is required to be able to infer the update channel in the following updates, removing it would translate to a pinned version.

@loispostula loispostula force-pushed the 3507-githubrelease-hash branch from fe8d985 to 632ff8c Compare January 8, 2025 12:05
@loispostula loispostula changed the title feat: make githubrelease accept a key argument githubaction autodiscovery should allow for pinning version to commit hash Jan 8, 2025
@loispostula loispostula force-pushed the 3507-githubrelease-hash branch from 7c4c2dd to 7b640f6 Compare January 8, 2025 13:13
@loispostula loispostula force-pushed the 3507-githubrelease-hash branch from 7b640f6 to 8bfd7ec Compare January 8, 2025 13:15
@loispostula loispostula force-pushed the 3507-githubrelease-hash branch from 8c2cb4c to 0342d27 Compare January 8, 2025 13:35
@loispostula loispostula requested review from dduportal and olblak and removed request for dduportal January 8, 2025 13:35
@olblak
Copy link
Member

olblak commented Jan 9, 2025

Fix part of #3507
Do you need more than the current pullrequest?
It sounds almost complete to me

@loispostula loispostula force-pushed the 3507-githubrelease-hash branch from 9097a51 to da11f17 Compare January 9, 2025 22:13
@loispostula loispostula requested a review from olblak January 9, 2025 23:42
@olblak olblak added the enhancement New feature or request label Jan 11, 2025
Copy link
Member

@olblak olblak left a comment

Choose a reason for hiding this comment

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

Minor comment but the pullrequest is ready to be merged with or without my suggestion

@olblak olblak merged commit 68cdd96 into updatecli:main Jan 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: githubaction autodiscovery should allow for pinning version to commit hash
2 participants