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

Add support for GitHub token #59

Open
rvignolo opened this issue May 13, 2024 · 6 comments
Open

Add support for GitHub token #59

rvignolo opened this issue May 13, 2024 · 6 comments

Comments

@rvignolo
Copy link

It would be great if we could be able to send a GitHub token to the docker image such that it can fetch private repositories and perform the reproducible build with this as well.

What do you think?

@andreibancioiu
Copy link
Contributor

andreibancioiu commented May 14, 2024

Hello @rvignolo,

Generally speaking, the GitHub token should not be passed to the workflow that does the reproducible build.

In your private repository, do this:

...

permissions:
  contents: write

jobs:
  build:
    uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml...

Let us know how it goes 🙏

Additional references:

@rvignolo
Copy link
Author

Hi @andreibancioiu!

Sorry, let me better explain. Our actions are working properly. The issue arises when there is a dependency of one smart contract A with another smart contract B, and the smart contract B is hosted in a private repository. Then, we need to give credentials for the CI.

This can be solved using GitHub Deploy Keys. We are using those in conjunction with the following action:

      - name: Setup Credentials
        uses: webfactory/[email protected]
        if: inputs.has-private-dependencies
        with:
          ssh-private-key: |
            ${{ secrets.sc-1-deploy-pk }}
            ${{ secrets.sc-2-deploy-pk }}
            ${{ secrets.sc-3-deploy-pk }}

and it works.

The problem is with the reproducible build. We need to give credentials to the docker instance. We are currently using cargo vendor to solve the problem. Any ideas?

@rvignolo
Copy link
Author

@andreibancioiu I can open a PR if wanted! Thanks!

@rvignolo
Copy link
Author

rvignolo commented May 17, 2024

@andreibancioiu PR has been opened here. Thanks!

@andreibancioiu
Copy link
Contributor

Hello @rvignolo,

Sorry for the delay 🙏

We'll have a look (at the general matter and on the PR) 🙌

@rvignolo
Copy link
Author

Thank you so much @andreibancioiu!

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