Protocol.Land Docs
HomeBlogGit Repo
  • 👋Welcome to Protocol.Land
  • 🗄️Working with Repositories
    • Create a new repository
    • Fork a repository
    • Clone a repository
    • Import a repository from GitHub
    • Create a new branch
    • Update a repository’s general information
    • Add contributors to a repository
    • Tokenization
  • 📁Working with Files
    • Create a new file
    • Add file/ files
    • Edit a file
  • 💻Working with Pull Requests
    • Create a new pull request
    • Create a new pull request from a fork
    • Add reviewers to a pull request
    • Approve a pull request
    • Comment on a pull request
    • Merge a pull request
    • Close a pull request
    • Reopen a pull request
  • 📄Working with Issues
    • Create a new issue
    • Assign an issue
    • Comment on an issue
    • Close an issue
    • Reopen an issue
    • Create a new bounty
    • Close a bounty
  • 🚀Working with Deployments
    • Deploy a static page
    • Assign an ArNS name
  • working with organizations
    • Create a new organization
    • Create a new repository
    • Import a repository from GitHub
    • Add members to organization
    • See List of Organizations you are part of
    • Transfer your repo to organization
  • ℹ️Working with Profiles
    • Customize your profile details
    • Add a README for your profile
    • Explore contribution activity
Powered by GitBook
On this page
Edit on GitHub
  1. working with organizations

Import a repository from GitHub

Backup a GitHub repository directly to an organization on Protocol.Land.

Backing up your repository to an organization you own on Protocol.Land helps you group your repositories you import from Github with managed access control.

Follow these steps to backup your GitHub repository to an organization on Protocol.Land:

  1. Navigate to your GitHub repository and go to the "Settings" tab.

  2. Under "Secrets and variables," select "Actions" then click "New Repository Secret."

  3. Add a new secret with "Name" as “WALLET”, paste your Arweave wallet's JWK into the "Secret" field, and click "Add secret."

  4. Go to the "Actions" tab of your repository.

  5. Click "New workflow" if you have existing actions, or follow the prompt to "Get started with GitHub Actions" if it's your first time.

  6. Choose to "Set up a workflow yourself."

  7. In the .yml file that appears, copy and paste the provided YAML code and commit the changes. This code includes crucial steps, such as checking out all branches and setting up node environments before syncing to Protocol Land.

name: Protocol Land Sync
on:
    # Run with every push to 'main' branch:
    push:
        branches:
            - 'main'
    # Run Manually:
    #workflow_dispatch:
jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - name: 'Checkout repo (default branch)'
              uses: actions/checkout@v3
              with:
                  # fetch all history for all branches:
                  fetch-depth: 0
            - name: 'Checkout all branches'
              run: |
                  default_branch=$(git branch | grep '*' | sed 's/\* //')
                  for abranch in $(git branch -a | grep -v HEAD | grep remotes | sed "s/remotes\/origin\///g"); do git checkout $abranch ; done
                  git checkout $default_branch
                  git branch -a
            - name: 'Setup node 18'
              uses: actions/setup-node@v3
              with:
                  node-version: 18.x
            - name: 'Sync repo to Protocol Land'
              run: npx @protocol.land/sync
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                  REPO_TITLE: ${{ github.event.repository.name }}
                  REPO_DESCRIPTION: ${{ github.event.repository.description }}
                  WALLET: ${{ secrets.WALLET }}
                  ORGANIZATION_NAME: protocol-land ## <- Edit this to Name of your organization
  1. The code is set to automatically execute with every push to the main branch. For manual execution, modify the on: section to include workflow_dispatch:.

  2. If desired, you can adjust the workflow to only sync the main branch by commenting out the 'Checkout all branches' section.

  3. Navigate to your organization page on Protocol.Land.

  4. Under "Repositories" tab you should now see the imported repo.

Add published badge to your Github repo

When you sync your GitHub repo with Protocol.Land, proudly display the "Published on Protocol.land" badge in your README. Use the below template and replace <REPO_ID> with your Protocol.Land repo ID:

[![protocol.land](https://arweave.net/eZp8gOeR8Yl_cyH9jJToaCrt2He1PHr0pR4o-mHbEcY)](https://protocol.land/#/repository/<REPO_ID>)
PreviousCreate a new repositoryNextAdd members to organization

Last updated 2 months ago

Using the above line in your README file will show Published on Protocol.Land badge like this one .