mirror of https://github.com/Desuuuu/klipper.git
fix sync action
This commit is contained in:
parent
b4b0a1993f
commit
3b41fc1712
|
@ -9,19 +9,37 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Sync
|
- name: Merge changes
|
||||||
uses: tgymnich/fork-sync@v1.3.0
|
uses: actions/github-script@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.TOKEN }}
|
||||||
owner: KevinOConnor
|
script: |
|
||||||
base: snapshot
|
const timeout = (ms) => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
head: master
|
|
||||||
merge_method: merge
|
const { data: pullRequest } = await github.pulls.create({
|
||||||
pr_title: Upstream sync
|
owner: context.repo.owner,
|
||||||
ignore_fail: false
|
repo: context.repo.repo,
|
||||||
|
title: "Upstream sync",
|
||||||
|
head: "KevinOConnor:master",
|
||||||
|
base: "snapshot",
|
||||||
|
maintainer_can_modify: false
|
||||||
|
})
|
||||||
|
|
||||||
|
await timeout(3000)
|
||||||
|
|
||||||
|
await github.pulls.merge({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
pull_number: pullRequest.number,
|
||||||
|
commit_title: "Merge upstream changes",
|
||||||
|
merge_method: "merge"
|
||||||
|
})
|
||||||
|
|
||||||
|
await timeout(3000)
|
||||||
- name: Checkout snapshot
|
- name: Checkout snapshot
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
token: ${{ secrets.TOKEN }}
|
||||||
ref: snapshot
|
ref: snapshot
|
||||||
- name: Generate tag parameters
|
- name: Generate tag parameters
|
||||||
id: params
|
id: params
|
||||||
|
@ -31,9 +49,11 @@ jobs:
|
||||||
- name: Create tag
|
- name: Create tag
|
||||||
uses: actions/github-script@v3
|
uses: actions/github-script@v3
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
const tagResponse = await github.git.createTag({
|
const timeout = (ms) => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
|
||||||
|
const { data: tag } = await github.git.createTag({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag: "${{ steps.params.outputs.tagname }}",
|
tag: "${{ steps.params.outputs.tagname }}",
|
||||||
|
@ -41,9 +61,12 @@ jobs:
|
||||||
object: "${{ steps.params.outputs.tagsha }}",
|
object: "${{ steps.params.outputs.tagsha }}",
|
||||||
type: "commit"
|
type: "commit"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await timeout(3000)
|
||||||
|
|
||||||
await github.git.createRef({
|
await github.git.createRef({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
ref: `refs/tags/${tagResponse.data.tag}`,
|
ref: `refs/tags/${tag.tag}`,
|
||||||
sha: `${tagResponse.data.sha}`
|
sha: `${tag.sha}`
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue