Skip to content

Commit 73db1be

Browse files
Bug fix: Fix update-documentation action (devcontainers#72)
fix update-documentation action
1 parent 535799a commit 73db1be

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/update-documentation.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,27 @@ jobs:
2020

2121
- name: Add and Commit Documentation
2222
id: push_image_info
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2325
run: |
2426
set -e
2527
echo "Start."
2628
27-
GIT_BRANCH=$(echo "${{ github.ref }}" | grep -oP 'refs/(heads|tags)/\K(.+)')
28-
if [ "$GIT_BRANCH" == "" ]; then
29-
echo "ERR: Could not determine branch."
30-
exit 1
31-
fi
32-
33-
echo "GIT_BRANCH = ${GIT_BRANCH}"
34-
35-
git config --global user.email "vscr-feedback@microsoft.com"
36-
git config --global user.name "Devcontainers CI"
29+
# Configure git and Push updates
30+
git config --global user.email github-actions@github.com
31+
git config --global user.name github-actions
3732
git config pull.rebase false
3833
39-
# # Pull in anything that may have come in
40-
# git pull "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH"
34+
branch=automated-documentation-update-$GITHUB_RUN_ID
35+
git checkout -b $branch
36+
message='Automated documentation update'
4137
4238
# Add / update and commit
4339
git add */**/README.md
44-
git status
4540
git commit -m 'Automated documentation update' || export NO_UPDATES=true
4641
4742
# Push
4843
if [ "$NO_UPDATES" != "true" ] ; then
49-
git push "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:$GIT_BRANCH"
50-
fi
44+
git push origin "$branch"
45+
gh pr create --title "$message" --body "$message"
46+
fi

0 commit comments

Comments
 (0)