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

Create README.md to explain the workflow files and how to utilize build_pkg.yml workflow from other packages #12

Closed
alee-ntap opened this issue Nov 13, 2023 · 2 comments
Assignees

Comments

@alee-ntap
Copy link
Contributor

Here is the draft one from previous discussions:

Certainly. Allow me to explain the situation first, and then we can determine the best location for this document.

The build_pkg.yml file serves as a reusable workflow that other packages can utilize. When modifications are made to the build_pkg.yml workflow, it often requires corresponding changes in the build_* scripts to handle the input variables or something else. Consequently, the git branch in build-package project should include changes to both the build_pkg.yml and build_* scripts together.

Without bind-mounting the build_* scripts inside the container, we would be unable to effectively test the build_pkg.yml workflow if the corresponding changes to the build_* scripts in the same branch are not present inside the container.

In addition to the specific utilize of the build_pkg.yml workflow from a particular branch using @workflow-branch-name, as demonstrated in this example: https://github.com/gardenlinux/package-htop/actions/runs/6823007358/workflow
There is an additional aspect to consider. When the actions/checkout action is used with repository: but without the ref:, it checkouts the default branch of the repository. Therefore, it is necessary to explicitly specify the ref: option with the workflow-branch-name that specific utilize from other packages along with the repository, as shown below:

      - uses: actions/checkout@v4
        with:
          repository: gardenlinux/package-build
          ref: workflow-branch-name

This explains the presence of the ref: ${{ github.ref_name }} line in the previous version of this PR. I believe it won't harm to the workflow to cause any issues if the workflow is utilized by other packages in the default branch, as the variable will also be changed to the default branch.
(However, it's a workaround for testing purposes. I dropped it due to it's unrelated to the goal of this PR. Please let me know if we do need it or just to be needed in this document.)

Now, let's discuss the most appropriate placement and title for this document. :)

Originally posted by @alee-ntap in gardenlinux/package-build#8 (comment)

@alee-ntap alee-ntap self-assigned this Nov 13, 2023
@alee-ntap
Copy link
Contributor Author

@nanory
Copy link
Contributor

nanory commented Nov 30, 2023

Is done by #34

@nanory nanory closed this as completed Dec 4, 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

No branches or pull requests

2 participants