-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to a different icon for echoed commands
Previously used `▶` icon was the same as the icon used by GH to sygnalize collapsable content. We're switching to `➞` to not suggest the icon is clickable.
- Loading branch information
1 parent
57e7962
commit 9f83743
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,47 +234,47 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.githubToken }} | ||
run: | | ||
echo "▶ Configure environment variables" | ||
echo "➞ Configure environment variables" | ||
head_branch=auto-update-solidity-api-docs | ||
base_branch=${{ inputs.destinationBaseBranch }} | ||
echo "▶ Checkout destination repo" | ||
echo "➞ Checkout destination repo" | ||
git clone --branch $base_branch \ | ||
https://${{ inputs.userName }}:[email protected]/${{ inputs.destinationRepo }}.git \ | ||
dest-repo-clone | ||
echo "▶ Create/checkout head branch" | ||
echo "➞ Create/checkout head branch" | ||
cd dest-repo-clone | ||
git checkout $head_branch || git checkout -b $head_branch | ||
echo "▶ Synchronize docs" | ||
echo "➞ Synchronize docs" | ||
mkdir -p ${{ inputs.destinationFolder }} | ||
rsync -avh ${{ inputs.rsyncDelete && '--delete' || '' }} \ | ||
../generated-docs \ | ||
${{ inputs.destinationFolder }} | ||
echo "▶ Commit changes" | ||
echo "➞ Commit changes" | ||
git add -A | ||
if git status | grep -q "Changes to be committed" | ||
then | ||
git config --global user.email ${{ inputs.userEmail }} | ||
git config --global user.name ${{ inputs.userName }} | ||
git commit ${{ inputs.verifyCommits && '-S' || '' }} \ | ||
-m "Update docs by https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}}" | ||
echo "▶ Push commit" | ||
echo "➞ Push commit" | ||
git push --set-upstream origin HEAD:$head_branch | ||
echo "▶ Check if PR for the head branch already exists" | ||
echo "➞ Check if PR for the head branch already exists" | ||
dest_org=$(echo ${{ inputs.destinationRepo }} | cut -d'/' -f1) | ||
pr_for_head=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/repos/${{ inputs.destinationRepo }}/pulls?status=open&head=$dest_org:$head_branch") | ||
if [[ $pr_for_head == $'[\n\n]' ]]; then | ||
echo "▶ Checked. A PR for the head branch ($head_branch) will be created" | ||
echo "➞ Checked. A PR for the head branch ($head_branch) will be created" | ||
hub pull-request --base $base_branch \ | ||
--message "Update Solidity API docs" \ | ||
--message "Docs updated by workflow: https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id}}" | ||
else | ||
echo "▶ Checked. A PR for head branch ($head_branch) already exists and got updated." | ||
echo "➞ Checked. A PR for head branch ($head_branch) already exists and got updated." | ||
fi | ||
else | ||
echo "▶ No changes detected, no commits will be made." | ||
echo "➞ No changes detected, no commits will be made." | ||
exit 0 | ||
fi |