Skip to content

Commit

Permalink
🎨 using checkout action for gitops
Browse files Browse the repository at this point in the history
  • Loading branch information
flaxel committed Jul 2, 2022
1 parent ae11124 commit b6bf9f2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,17 @@ runs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Checkout GitOps Repository
if: inputs.gitopsenabled == 'true'
uses: actions/checkout@v3
with:
repository: ${{ inputs.gitopsorganization }}/${{ inputs.gitopsrepository }}
token: ${{ inputs.gitopstoken }}
path: .github/${{ inputs.gitopsrepository }}

- name: Update Docker Image in Repository
if: inputs.gitopsenabled == 'true'
working-directory: .github/${{ inputs.gitopsrepository }}
shell: bash
run: |
commit_changes () {
Expand All @@ -152,12 +161,9 @@ runs:
fi
}
# configure git user
git config --global user.email "${{ inputs.gitopsemail }}" && git config --global user.name "${{ inputs.gitopsuser }}"
git clone https://${{ inputs.gitopsuser }}:${{ inputs.gitopstoken }}@github.com/${{ inputs.gitopsorganization }}/${{ inputs.gitopsrepository }}.git .github/${{ inputs.gitopsrepository }}
cd .github/${{ inputs.gitopsrepository }}
echo "Repository ${{ inputs.gitopsorganization }}/${{ inputs.gitopsrepository }} was cloned successfully "
if [[ ( $GITHUB_REF == refs/heads/master || $GITHUB_REF == refs/heads/main ) && -n "${{ inputs.gitopsstage }}" ]]; then
echo "Run update for STAGE"
while IFS= read -r line; do
Expand Down

0 comments on commit b6bf9f2

Please sign in to comment.