Update gh-sync-cc.yml #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync GitHub with AWS CodeCommit for AV/ADAS Solutions | |
on: | |
# Triggers the workflow on push or pull request events but only for the "addf-sonarscan-branch" branch | |
push: | |
branches: ["addf-sonarscan-branch"] | |
pull_request: | |
branches: ["addf-sonarscan-branch"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Permission can be added at job level or workflow level | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
# if: github.ref == 'refs/heads/addf-sonarscan-branch' | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: configure aws credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: arn:aws:iam::560360184571:role/GitHubAction-AssumeRoleWithAction #change to reflect your IAM role’s ARN | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: us-west-2 | |
# # Hello from AWS: WhoAmI print | |
# - name: Sts GetCallerIdentity | |
# run: | | |
# aws sts get-caller-identity | |
- name: Install utilities | |
run: | | |
pip install git-remote-codecommit | |
git clone codecommit::us-west-2://autonomous-driving-data-framework autonomous-driving-data-framework-gh-copy | |
ls -al autonomous-driving-data-framework-gh-copy | |
# Copy modules one by one | |
echo "Copying modules one after the other" | |
cd autonomous-driving-data-framework-gh-copy && mkdir modules | |
cp -R ../modules/analysis modules/ | |
# cp -R modules/core autonomous-driving-data-framework-gh-copy/ | |
# cp -R modules/integration autonomous-driving-data-framework-gh-copy/ | |
ls -al modules/ | |
echo "Copyied modules" | |
# cd autonomous-driving-data-framework-gh-copy/ | |
git config --global user.email "[email protected]" | |
git config --global user.name "Srinivas" | |
git config --local init.defaultBranch main | |
git add -A | |
git status | |
git commit -m "sync gh with cc" | |
git remote -v | |
git branch -a | |
git status | |
git push origin |