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

Variables test #27

Closed
wants to merge 8 commits into from
Closed

Variables test #27

wants to merge 8 commits into from

Conversation

bquan0
Copy link
Collaborator

@bquan0 bquan0 commented Aug 21, 2023

This pull request is a test to see if it is possible to change env variables based on whether the triggering event is a pull_request or a push. It also tests if these changes made in one job will endure into jobs that occur afterwards.

This test is motivated by the virtualbox PR on PyNE, which has the workflows being triggered by pull_request failing because env.DOCKER_IMAGE_TAG changes to something different than the tag of the images in ghcr.io when the triggering event is a pull_request.

This pull request doesn't need to be merged, and I will probably close it after I have worked out all the syntax and nuances necessary. I may also push this variables-test branch onto the cnerg repo instead of my forked repo if the workflow I added is not being run.

@bquan0
Copy link
Collaborator Author

bquan0 commented Aug 21, 2023

The conclusion of this test is that it is possible to change the env variable DOCKER_IMAGE_TAG if the triggering event is a pull_request. However, the change must be done in every job because the change doesn't carry over to future jobs, even if those future jobs depend on the job where the change occurred.

One more thing to note is that it's not possible to replace github.ref_name with github.head_ref because head_ref only has the branch name when the triggering event is a pull_request.

I will close this PR when the PR in PyNE is closed in case I need to do more testing or refining of this method.

@bquan0
Copy link
Collaborator Author

bquan0 commented Aug 23, 2023

I'm closing this PR now that we've decided to use other solutions in the PyNE PR which involve not knowing the tag that is assigned to internal images built by the multistage action.

@bquan0 bquan0 closed this Aug 23, 2023
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.

1 participant