Skip to content

Commit

Permalink
chore: automatic rebase tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ErwannLeRoux committed Aug 16, 2023
1 parent fa1ab42 commit 6f3e471
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 26 deletions.
60 changes: 34 additions & 26 deletions .github/workflows/automatic-rebase.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
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/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)
const branches = result.repository.pullRequests.nodes.map(node => node.headRefName)
- name: gh test
run: |
ls -la
gh pr list --label Module --limit 50
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
13 changes: 13 additions & 0 deletions bin/conflicts.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6f3e471

Please sign in to comment.