Skip to content

repo sync #2198

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

Merged
merged 2 commits into from
Dec 17, 2020
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
11 changes: 7 additions & 4 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}

- name: Create pull request
id: create-pull
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
Expand Down Expand Up @@ -72,9 +73,10 @@ jobs:

# There are cases where the branch becomes out-of-date in between the time this workflow began and when the pull request is created/updated
- name: Update branch
if: ${{ steps.find-pull-request.outputs.number }}
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const mainHeadSha = await github.git.getRef({
...context.repo,
Expand All @@ -84,13 +86,14 @@ jobs:

const pull = await github.pulls.get({
...context.repo,
pull_number: ${{ steps.find-pull-request.outputs.number }}
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
})
console.log(`Pull request base sha: ${pull.data.base.sha}`)

if (mainHeadSha.data.object.sha !== pull.data.base.sha) {
if (mainHeadSha.data.object.sha !== pull.data.base.sha || pull.data.mergeable_state === 'behind') {
const updateBranch = await github.pulls.updateBranch({
...context.repo,
pull_number: ${{ steps.find-pull-request.outputs.number }}
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
})
console.log(updateBranch.data.message)
} else {
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Enums
redirect_from:
- /v4/enum
- /v4/reference/enum
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/input-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Input objects
redirect_from:
- /v4/input_object
- /v4/reference/input_object
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Interfaces
redirect_from:
- /v4/interface
- /v4/reference/interface
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Mutations
redirect_from:
- /v4/mutation
- /v4/reference/mutation
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Objects
redirect_from:
- /v4/object
- /v4/reference/object
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Queries
miniTocMaxHeadingLevel: 2
redirect_from:
- /v4/query
- /v4/reference/query
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/scalars.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Scalars
redirect_from:
- /v4/scalar
- /v4/reference/scalar
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down
1 change: 1 addition & 0 deletions content/graphql/reference/unions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Unions
redirect_from:
- /v4/union
- /v4/reference/union
versions:
free-pro-team: '*'
enterprise-server: '*'
Expand Down