diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-08-03 01:34:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 01:34:24 +0300 |
commit | 73db1be5838cc7b71e083819cb50c25b210a6bdc (patch) | |
tree | f5801cf6493d912d23b142e4c418c483f8d5bbdf /.github | |
parent | 535799a8fd232fc3b5e131cf070d9e7c5019ed11 (diff) |
Bug fix: Fix update-documentation action (#72)
fix update-documentation action
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/update-documentation.yml | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update-documentation.yml index 8e39b3f..58f74ed 100644 --- a/.github/workflows/update-documentation.yml +++ b/.github/workflows/update-documentation.yml @@ -20,31 +20,27 @@ jobs: - name: Add and Commit Documentation id: push_image_info + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e echo "Start." - GIT_BRANCH=$(echo "${{ github.ref }}" | grep -oP 'refs/(heads|tags)/\K(.+)') - if [ "$GIT_BRANCH" == "" ]; then - echo "ERR: Could not determine branch." - exit 1 - fi - - echo "GIT_BRANCH = ${GIT_BRANCH}" - - git config --global user.email "vscr-feedback@microsoft.com" - git config --global user.name "Devcontainers CI" + # Configure git and Push updates + git config --global user.email github-actions@github.com + git config --global user.name github-actions git config pull.rebase false - # # Pull in anything that may have come in - # git pull "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH" + branch=automated-documentation-update-$GITHUB_RUN_ID + git checkout -b $branch + message='Automated documentation update' # Add / update and commit git add */**/README.md - git status git commit -m 'Automated documentation update' || export NO_UPDATES=true # Push if [ "$NO_UPDATES" != "true" ] ; then - git push "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH" - fi
\ No newline at end of file + git push origin "$branch" + gh pr create --title "$message" --body "$message" + fi |