devops-center-roadmap icon indicating copy to clipboard operation
devops-center-roadmap copied to clipboard

Setup of the git repo

Open ombr opened this issue 10 months ago • 2 comments

Hi,

When I setup a new org with DevOps center it would be great if It could create the github or bitbucket repo for me. So that I could start using it in a few clicks.

Currently, you need to download and create the repo manually which is reducing the ability for non developer user to use DevOps Center.

While trying to use devops center we ended up with a github action:

 name: Salesforce Daily Diff

on:
  schedule:
    - cron: '0 0 */2 * *'  # Runs at midnight every 2 days
  push:
    branches:
      - master
  workflow_dispatch:

permissions:
  contents: write

jobs:
  diff:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Repository
      uses: actions/checkout@v2

    - name: Install Salesforce CLI
      run: npm install @salesforce/cli --global

    - name: Create Certificate File
      run: |
        path="dx.key"
        if [ ! -f "$path" ]; then
          echo "${{ secrets.SF_JWT_KEY }}" | tr '|' '\n' > "$path"
        fi
        echo "./$path"

    - name: Hub Login
      run: sf force auth jwt grant --client-id ${{ secrets.SF_CLIENT_ID }} --username ${{ secrets.SF_USERNAME }} --jwt-key-file ./dx.key --set-default --json

    - name: Delete Certificate File
      run: rm -f dx.key
    - name: Set Date Variable
      run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

    - name: Fetch Latest Code
      run: git fetch origin

    - name: Check Out Master Branch
      run: git checkout master
  
    - name: Retrieve All Metadata
      run: sf project retrieve start --manifest manifest/package.xml
    
    - name: Configure Git
      run: |
        git config --global user.name 'github-actions'
        git config --global user.email '[email protected]'
    
    - name: Check for Changes
      id: changes
      run: git diff --quiet || echo "has_changes=true" >> $GITHUB_ENV

    - name: Exit if No Changes
      if: env.has_changes != 'true'
      run: echo "No changes detected. Exiting." && exit 0

    - name: Stage All Changes
      if: env.has_changes == 'true'
      run: git add -A

    - name: Commit and Push Changes
      if: env.has_changes == 'true'
      run: |
        git commit -m "Daily Salesforce metadata update - ${{ env.CURRENT_DATE }}"
        git push origin master

Thanks.

ombr avatar Mar 11 '25 16:03 ombr

Hi @ombr - Thank you for your request. Are you asking for DevOps Center to create the repository for you or to seed the repository with the org metadata when creating a project?

GilsonCanario avatar Jun 05 '25 15:06 GilsonCanario

Hi @GilsonCanario, I am asking DevOps center to create and seed the repo. Something that would make the setup work in a few clicks.

ombr avatar Jul 21 '25 15:07 ombr