Skip to content

added screenshots part 1 #6

added screenshots part 1

added screenshots part 1 #6

Workflow file for this run

on:
workflow_dispatch:
push:
branches: main
name: Mirror to Internal
env:
GITHUB_TOKEN: ${{ secrets.GH_ENTERPRISE_TOKEN }}
GHE_USER: ${{ vars.SYNC_USER }}
GHE_FULL_USER: ${{ vars.SYNC_USER_NAME }}
ENTERPRISE_URL: ${{ vars.ENTERPRISE_GIT_URL }}
ENTERPRISE_EMAIL: ${{ vars.SYNC_USER_EMAIL }}
TEMPLATE_NAME: 'ibm-client-engineering/solution-template-quarto'
CEBOT_GH_TRAVIS_TOKEN: ${{ secrets.CEBOT_GH_TRAVIS_TOKEN }}
CEBOT_TRAVIS_API_KEY: ${{ secrets.CEBOT_TRAVIS_API_KEY }}
TRAVIS_API_ENDPOINT: ${{ vars.TRAVIS_API_ENDPOINT }}
jobs:
verify_and_mirror:
runs-on: ubuntu-latest
steps:
- name: Check if remote enterprise repo exists
id: repocheck
if: ${{github.repository == env.TEMPLATE_NAME}}
run: git ls-remote https://${{ env.GHE_USER }}:${{ env.GITHUB_TOKEN }}@${{ env.ENTERPRISE_URL }}/${{ github.repository }} -q --exit-code
- name: Create remote repo
if: ${{ failure() && steps.repocheck.conclusion == 'failure' && github.repository == env.TEMPLATE_NAME}}
run: |
echo ${{ env.GITHUB_TOKEN }} > /tmp/token.txt
gh auth login -p https -h ${{ env.ENTERPRISE_URL }} --with-token < /tmp/token.txt
gh repo create --public ${{ github.repository }}
- name: Checkout repo and all branches to stage
id: checkout
if: ${{github.repository == env.TEMPLATE_NAME}}
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
fetch-depth: 0
- name: Mirror the repo up to our internal github
id: mirror
if: ${{github.repository == env.TEMPLATE_NAME}}
uses: yesolutions/mirror-action@master
with:
REMOTE: 'https://${{ env.ENTERPRISE_URL }}/${{ github.repository }}'
GIT_USERNAME: ${{ env.GHE_USER }}
GIT_PASSWORD: ${{ env.GITHUB_TOKEN }}
- name: Set Travis Var (gh token)
id: travis
if: ${{github.repository == env.TEMPLATE_NAME}}
env:
REPO_NAME: "solution-template-quarto"
run: |
curl -X POST \
-H "Content-Type: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${{ env.CEBOT_TRAVIS_API_KEY }}" \
-d '{ "env_var.name": "GITHUB_TOKEN", "env_var.value": "${{ env.CEBOT_GH_TRAVIS_TOKEN }}", "env_var.public": false }' \
${{ env.TRAVIS_API_ENDPOINT }}/repo/${{ github.repository_owner }}%2F${{ env.REPO_NAME }}/env_vars