Unverified Commit da051d3a authored by Amy Stamile's avatar Amy Stamile Committed by GitHub
Browse files

Github to Gitlab CI - CodeBuild (#5548)

* Github to Gitlab CI

* small updates

* switch to code.usgs.gov

* try username

* debug CI

* more testing

* test pull_request_target

* trigger for all branches

* fix trigger

* add git config
parent 64d66599
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
name: Github to Gitlab CI - Run CodeBuild

env:
  PR_NUMBER: ${{ github.event.number }}
  GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}

on:
  pull_request_target:
    branches: 
      - '**'

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Run script
        run: |
          git config --global user.name "abc"
          git config --global user.email "abc@example.com"
          git clone https://isis-codebuild-ci:$GITLAB_TOKEN@code.usgs.gov/astamile1/isis-codebuild-ci.git
          cd isis-codebuild-ci
          git checkout -b PR_$PR_NUMBER
          echo -e "\nenv: \n  shell: bash \n  variables: \n    PR_NUMBER: $PR_NUMBER \n    MERGE_BRANCH: $GITHUB_BASE_REF" >> buildspec.yml
          git commit -a -m "$PR_NUMBER"
          git push origin PR_$PR_NUMBER
          
          
 No newline at end of file