Skip to content

Commit

Permalink
Revert repo-sync to its old auto-merge strategy (#18189)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene authored Mar 9, 2021
1 parent 052a540 commit 3e96d63
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
destination_branch: main
pr_title: 'repo sync'
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
pr_label: autoupdate,automated-reposync-pr
pr_label: automerge,autoupdate,automated-reposync-pr
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}

- name: Find pull request
Expand Down Expand Up @@ -88,34 +88,6 @@ jobs:
console.log(`Branch is already up-to-date`)
}
- name: Enable GitHub auto-merge
if: ${{ steps.find-pull-request.outputs.number }}
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pull = await github.pulls.get({
...context.repo,
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
})
const pullNodeId = pull.data.node_id
console.log(`Pull request GraphQL Node ID: ${pullNodeId}`)
const mutation = `mutation ($id: ID!) {
enablePullRequestAutoMerge(input: {
pullRequestId: $id,
mergeMethod: MERGE
}) {
clientMutationId
}
}`
const variables = {
id: pullNodeId
}
await github.graphql(mutation, variables)
console.log('Auto-merge enabled!')
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure()
Expand Down

0 comments on commit 3e96d63

Please sign in to comment.