ts-amz is syncing repo to CodeCommit #123
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 | |
run-name: ${{ github.actor }} is syncing repo to CodeCommit | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '*' | |
workflow_dispatch: {} | |
jobs: | |
sync: | |
if: github.repository_owner == 'aws' | |
name: Sync to CodeCommit | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT }}:role/${{ secrets.ROLE }} | |
aws-region: ${{ secrets.REGION }} | |
- name: Push | |
run: | | |
echo "Pushing tag: $GITHUB_REF_NAME" | |
git config --global --add safe.directory /github/workspace | |
git config --global credential.'https://git-codecommit.*.amazonaws.com'.helper '!aws codecommit credential-helper $@' | |
git config --global credential.UseHttpPath true | |
git remote add code_commit_repo "https://git-codecommit.${{ secrets.REGION }}.amazonaws.com/v1/repos/${{ secrets.REPO }}" | |
git push code_commit_repo $GITHUB_REF_NAME |