-
Notifications
You must be signed in to change notification settings - Fork 6
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
remove global env variables and replaces them by step-based env variables #180
base: main
Are you sure you want to change the base?
Conversation
…bles if needed. Following changes have been done do several workflows: ## NODE_AUTH_TOKEN The secrets.NODE_AUTH_TOKEN was removed from global "env" and added to "Setup up node"-step as local "env"-variable ## GITHUB_USER_SSH_KEY Removed from global "env" and 1. moved to actions/checkout@v4 "with.ssh-key" directly. 2. moved as local "env" variables to "Set up SSH"-step. ## GITHUB_USER_SSH_PUBLIC_KEY The public SSH Key was removed from global "env" and injected into "Delete signing key files"- and "Set up signin commits"-steps as local "env" variable. # GITHUB_USER_EMAIL and GITHUB_USER_NAME Remove both secrets from global "env" and moved them into "Set up Git"-step as local "env" variables.
We might want to discuss if this is correct: - name: Set up Git
env:
GITHUB_USER_EMAIL: ${{ secrets.GITHUB_USER_EMAIL }}
GITHUB_USER_NAME: ${{ secrets.GITHUB_USER_NAME }}
if: ${{ env.GITHUB_USER_EMAIL != '' && env.GITHUB_USER_NAME != '' }}
run: |
git config --global user.email "${{ env.GITHUB_USER_EMAIL }}"
git config --global user.name "${{ env.GITHUB_USER_NAME }}" both, the As alternative we could use something like: - name: Set up Git
run: |
${{ secrets.GITHUB_USER_EMAIL != '' }} && git config --global user.email "${{ secrets.GITHUB_USER_EMAIL }}"
${{ secrets.GITHUB_USER_NAME != '' }} && git config --global user.name "${{ secrets.GITHUB_USER_NAME }}" and/or we could also print a message (or document down), that if you decide to "Set up Git" you need both in order to function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. I left a couple of comments.
Is there any use case where we just want to have 1 set or are both always required to ensure that it works?
I would keep this as-is.
@@ -65,11 +65,7 @@ jobs: | |||
env: | |||
COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason not to also move COMPOSER_AUTH
to the corresponding step? This applies to the other workflows, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we need to test. Depending on how/where we execute composer
, we might need to have it globally available in order to be used in those steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I'm pretty sure we only execute composer install
once per workflow. But setting a local env multiple times shouldn't be a problem because that's what we do with other env variables s as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we execute composer
commands multiple times, moving the auth json in the setup PHP step will make the composer auth configuration available for all composer commands in the whole workflow. I think we can move it safely 🤔
Co-authored-by: Philipp Bammes <[email protected]> Signed-off-by: Christian Leucht <[email protected]>
…feature/remove-global-env
…ONS out of global env variables.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Following changes have been done do several workflows:
NODE_AUTH_TOKEN
The
secrets.NODE_AUTH_TOKEN
was removed from global "env" and added to "Setup up node"-step as local "env"-variableGITHUB_USER_SSH_KEY
Removed from global "env" and
actions/checkout@v4
andwith.ssh-key
directly.GITHUB_USER_SSH_PUBLIC_KEY
The public SSH Key was removed from global "env" and injected into "Delete signing key files"- and "Set up signin commits"-steps as local "env" variable.
GITHUB_USER_EMAIL
andGITHUB_USER_NAME
Remove both secrets from global "env" and moved them into "Set up Git"-step as local "env" variables.