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

chore: replace repository name and owner with Github context variables #124

Closed
wants to merge 2 commits into from
Closed

Conversation

matthiashermsen
Copy link
Contributor

No description provided.

@matthiashermsen matthiashermsen requested a review from a team February 25, 2024 17:08
Copy link
Member

@goloroden goloroden left a comment

Choose a reason for hiding this comment

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

Hi @matthiashermsen 👋

Thanks for the PR.

I've taken a look at it, but TBH I'm not convinced yet. In the end, it makes it harder to read which repository gets targeted, since now you don't have the single possible value hard-coded, but need to defer it from three different variables.

Am I missing a benefit here?

@@ -76,7 +76,7 @@ jobs:
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: docker/build-push-action@v5
env:
DOCKER_REPOSITORY: ghcr.io/thenativeweb/get-next-version
DOCKER_REPOSITORY: ghcr.io/${{ github.repository }}
Copy link
Member

@goloroden goloroden Feb 26, 2024

Choose a reason for hiding this comment

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

Why aren't you using the repository_owner and the event.repository.name here as well (or, vice-versa, why aren't you using this field above)?

Shouldn't both places use the same value, given that both have the same hard-coded value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no special reason, I just replaced the "hard-coded" parts with Github variables.

  • github.event.repository.name returns the repository name ( without owner )
  • github.repository_owner returns the repository owner
  • github.repository returns both with a slash

So you could use

${{ github.repository_owner }}/${{ github.event.repository.name }}

too, yeah :)

@goloroden goloroden self-assigned this Feb 26, 2024
@goloroden goloroden added the Task label Feb 26, 2024
@matthiashermsen
Copy link
Contributor Author

Hi @matthiashermsen 👋

Thanks for the PR.

I've taken a look at it, but TBH I'm not convinced yet. In the end, it makes it harder to read which repository gets targeted, since now you don't have the single possible value hard-coded, but need to defer it from three different variables.

Am I missing a benefit here?

Hi @goloroden ,
IMHO this makes it easier to reuse workflows. If one changes repository names / ownerships the workflows still work because Github will inject the correct values.

@goloroden
Copy link
Member

Sorry for getting back to you that late … I have thought about this one, and TBH I don't see the benefit here, especially compared to that it makes it harder to guess what values are actually being used.

This makes debugging more work, for something that happens once in a lifetime.

Hence I'm going to close this one (without merging this).

I hope you aren't mad at me for this.

@goloroden goloroden closed this Mar 15, 2024
@matthiashermsen
Copy link
Contributor Author

Sorry for getting back to you that late … I have thought about this one, and TBH I don't see the benefit here, especially compared to that it makes it harder to guess what values are actually being used.

This makes debugging more work, for something that happens once in a lifetime.

Hence I'm going to close this one (without merging this).

I hope you aren't mad at me for this.

Sure, no problem :)

@matthiashermsen matthiashermsen deleted the patch-1 branch March 15, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants