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

Validating submodules with their corresponding branch #398

Open
jgalan opened this issue Apr 21, 2023 · 1 comment
Open

Validating submodules with their corresponding branch #398

jgalan opened this issue Apr 21, 2023 · 1 comment
Assignees

Comments

@jgalan
Copy link
Member

jgalan commented Apr 21, 2023

This issue comes after some discussions present at the following PR

rest-for-physics/axionlib#56 (comment)

I think a way around to solve this problem could be having a script that identifies if the present branch associtated to the PR that is being validated exists in the framework and returns master if not.

Something like:

echo "branchAtRepositoryExists.sh framework ${{ env.BRANCH_NAME }}"

Thus, in the submodule framework validation frameworkValidation.yml we would do something like:

echo "branchAtRepositoryExists.sh framework ${{ env.BRANCH_NAME }}" >> $VALIDATION_BRANCH
uses: rest-for-physics/framework/.github/workflows/validation.yml@$VALIDATION_BRANCH

Then we would change the following lines at the framework/validation.yml as follows:

axionlib-validation:

echo "branchAtRepositoryExists.sh axionlib ${{ env.BRANCH_NAME }}" >> $VALIDATION_BRANCH
uses: rest-for-physics/axionlib/.github/workflows/validation.yml@$VALIDATION_BRANCH

Then, as soon as we create a branch at the framework with the same name as the branch associated to the submodule PR, the submodule PR will trigger the pipelines at framework and submodules that have the same name as the PR, and if it does not exist it will use master.

EDIT:
Probably the script needs to receive the name of the repository. Thus two arguments would be necessary:

branchAtRepositoryExists.sh framework ${{ env.BRANCH_NAME }}
@juanangp juanangp self-assigned this Apr 21, 2023
@juanangp
Copy link
Member

echo "branchAtRepositoryExists.sh framework ${{ env.BRANCH_NAME }}" >> $VALIDATION_BRANCH
uses: rest-for-physics/framework/.github/workflows/validation.yml@$VALIDATION_BRANCH

It seems that the solution you propose is not supported by github actions, we can try some work around to trigger an action that triggers the workflow run from the appropiate branch, but seems rather complicated...

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

No branches or pull requests

2 participants