Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip refs/ from branch-name #295

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/docs-push.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Push docs to knowledgebase
on:
push:
branches: master
branches:
master
docs/push-to-knowledgebase-pr

jobs:
Copy-docs:
Expand All @@ -27,13 +29,14 @@ jobs:

- name: Get branch name
id: get_branch
run: echo "branch_name=sync/${{ github.event.ref }}_${{github.event.head_commit.id}}" >> $GITHUB_ENV
run: echo "branch_name=sync/${{ github.event.ref }}_${{github.event.head_commit.id}}"| sed -e "s/refs\///g"| sed -e "s/\/\//\//g" >> $GITHUB_ENV

- name: Commit changes
env:
GH_TOKEN: ${{ secrets.KNOWLEDGEBASE_PR_TOKEN }}
run: |
cd knowledge-base
echo ${{env.branch_name}}
git checkout -b ${{env.branch_name}}
git config user.name "${{ github.triggering_actor }}"
git config user.email "[email protected]"
Expand All @@ -45,6 +48,7 @@ jobs:
# Create PR
git ls-remote --get-url origin
git push -u origin ${{ env.branch_name }}
echo "Creating PR..."
gh pr create \
--body "This PR copies /docs files from ${{ github.event.repository.full_name }}." \
--title "${{ github.event.head_commit.message }}" \
Expand Down
Loading