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

Fix branch update permissions errors #79

Merged
merged 8 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:

- name: Run scripts/generate-dotnet.sh
run: scripts/generate-dotnet.sh ${{ matrix.platform }}

- name: Clean up build artifacts before syncing
run: dotnet clean stage/dotnet/$REPO_NAME/GitHub.Octokit.sln

- name: Clone the existing repository
run: |
cd ../
git clone https://github.com/octokit/$REPO_NAME.git

- name: Copy generated code to dotnet-sdk
run: |
run: |
cp -rf stage/dotnet/$REPO_NAME/. ../$REPO_NAME/ # copy everything
rsync -av --delete stage/dotnet/$REPO_NAME/src/ ../$REPO_NAME/src/ # delete files that are not generated

Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Run scripts/generate-dotnet.sh
run: scripts/generate-dotnet.sh ghes ${{ matrix.version }}

- name: Clean up build artifacts before syncing
run: dotnet clean stage/dotnet/dotnet-sdk-enterprise-server/GitHub.Octokit.sln

Expand All @@ -97,10 +97,14 @@ jobs:
cd ../
git clone https://github.com/octokit/dotnet-sdk-enterprise-server.git
cd dotnet-sdk-enterprise-server
if git show-ref --verify --quiet refs/heads/${{ matrix.version }}; then
git switch ${{ matrix.version }}
git fetch origin
if git show-ref --verify --quiet refs/remotes/origin/${{ matrix.version }}; then
git switch -c ${{ matrix.version }} --track origin/${{ matrix.version }}
echo "Branch ${{ matrix.version }} already exists; skipping creation and fetching from remote"
else
git switch -c ${{ matrix.version }}
echo "Branch ${{ matrix.version }} does not exist on remote; created locally"
git switch -
fi
cd ../

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ jobs:
cd ../
git clone https://github.com/octokit/go-sdk-enterprise-server.git
cd go-sdk-enterprise-server
if git show-ref --verify --quiet refs/heads/${{ matrix.version }}; then
git switch ${{ matrix.version }}
if git show-ref --verify --quiet refs/remotes/origin/${{ matrix.version }}; then
git switch -c ${{ matrix.version }} --track origin/${{ matrix.version }}
echo "Branch ${{ matrix.version }} already exists; skipping creation and fetching from remote"
else
git switch -c ${{ matrix.version }}
echo "Branch ${{ matrix.version }} does not exist on remote; created locally"
git switch -
fi
cd ../

Expand Down
Loading