diff --git a/.github/workflows/automatic-rebase.yml b/.github/workflows/automatic-rebase.yml index 4c23a07..39f021d 100644 --- a/.github/workflows/automatic-rebase.yml +++ b/.github/workflows/automatic-rebase.yml @@ -1,31 +1,19 @@ name: Automatic rebase on: - workflow_dispatch: ~ - push: - branches: - - master + workflow_dispatch: ~ + push: + branches: + - master jobs: - rebase: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - const query = `query($owner:String!, $name:String!, $labels:[String!]) { - repository(owner:$owner, name:$name){ - pullRequests(labels: $labels, first: 50) { - nodes { - headRefName - } - } - } - }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - labels: ['Module'] - } - const result = await github.graphql(query, variables) - console.log(result.data.repository.pullRequests.nodes) + rebase: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: gh test + run: | + gh pr list --label Module --limit 50 + gh repo clone ${{ github.repository }} -- --branch my-beautiful-branch + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/bin/conflicts.sh b/bin/conflicts.sh new file mode 100755 index 0000000..19ccd61 --- /dev/null +++ b/bin/conflicts.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +conflicts = $(git diff --check | grep -i conflict) + +if [[ $(conflicts) ]]; then + echo "There is conflicts !" + + for c in conflicts do + echo c >> rebase.md + done +else + echo "No conflicts" +fi \ No newline at end of file