Skip to content

Get rid of some repository variables - #223

Closed
colisee wants to merge 7 commits into
LibreBooking:masterfrom
colisee:actions
Closed

colisee wants to merge 7 commits into
LibreBooking:masterfrom
colisee:actions

Conversation

@colisee

@colisee colisee commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Let github actions build_image-develop.yml and build_image_release.yml retrieve the latest release of the librebooking:

  • application
  • docker image

Variables to be removed:

  • VERSION_LB_APP
  • VERSION_LB_IMG
  • DOCKER_REPOSITORY

steps:
-
id: get_release_img
uses: pozetronic/github-action-get-latest-release@master

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How trustworthy is this repo/project?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This might work instead:

steps:
  - name: Checkout code
    uses: actions/checkout@v4

  - name: Get latest release
    id: get_release
    env:
      GH_TOKEN: ${{ github.token }}
    run: |
      # Fetch the latest release tag name using the GitHub CLI
      LATEST_TAG=$(gh release view --json tagName -q ".tagName")
      echo "The latest release is $LATEST_TAG"
      
      # Output it for use in subsequent steps
      echo "latest_tag=$LATEST_TAG" >> "$GITHUB_OUTPUT"

  - name: Use the latest release tag
    run: |
      echo "The tag from the previous step was: ${{ steps.get_release.outputs.latest_tag }}"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, this would not work, for I need to retrieve the latest release from 2 different repos (have a look at build_image_release.yml).

If we want a generic solution, then we would need to curl the github API that returns the latest release https://api.github.com/repos/OWNER/REPO/releases and extract the output data

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We could also select other more recently updated actions, such as ophiosdev/github-action-latest-release

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A comment from Claude:

  2. Use gh instead of the third-party action. Two run: steps would do the same job with no outside dependency:
  - id: get_release_img
    env: { GH_TOKEN: "${{ github.token }}" }
    run: echo "release=$(gh release view -R ${{ github.repository }} --json tagName -q .tagName)" >> "$GITHUB_OUTPUT"
  - id: get_release_app
    env: { GH_TOKEN: "${{ github.token }}" }
    run: echo "release=$(gh release view -R librebooking/librebooking --json tagName -q .tagName)" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

As a final alternative, we could git clone and git tag to retrieve the info...

But at this stage, I believe that using one of the 2 github actions is the most effective solution for such a simple need

build-develop:
uses: ./.github/workflows/build_and_publish.yml
needs: get-data
uses: $/.github/workflows/build_and_publish.yml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you sure that this $ syntax is valid?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the $/ syntax is valid, as indicated here

steps:
-
id: get_release_img
uses: pozetronic/github-action-get-latest-release@master

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A comment from Claude:

  2. Use gh instead of the third-party action. Two run: steps would do the same job with no outside dependency:
  - id: get_release_img
    env: { GH_TOKEN: "${{ github.token }}" }
    run: echo "release=$(gh release view -R ${{ github.repository }} --json tagName -q .tagName)" >> "$GITHUB_OUTPUT"
  - id: get_release_app
    env: { GH_TOKEN: "${{ github.token }}" }
    run: echo "release=$(gh release view -R librebooking/librebooking --json tagName -q .tagName)" >> "$GITHUB_OUTPUT"

@colisee

colisee commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

This PR is replaced by PR #224

@colisee colisee closed this Oct 20, 2026
@colisee
colisee deleted the actions branch October 20, 2026 16:57
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.

2 participants