Skip to content

Commit

Permalink
Merge pull request polycube-network#327 from s41m0n/workflows/rebase
Browse files Browse the repository at this point in the history
Add workflow to rebase code with polycube-bot
  • Loading branch information
frisso committed Sep 3, 2020
2 parents ed90e68 + 77571f3 commit 486e96b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}

- name: Automatic rebase
uses: cirrus-actions/rebase@1.3
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

- name: Set the reaction for the comment
id: rebase_reaction
run: |
[[ ${{ job.status }} == 'success' ]] && \
echo ::set-output name=reaction::hooray || \
echo ::set-output name=reaction::confused
if: always()

- name: Report status as comment
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.BOT_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Rebase status: ${{ job.status }}!
reactions: '${{ steps.rebase_reaction.outputs.reaction }}'
if: always()

always_job:
name: Always run job
runs-on: ubuntu-latest
steps:
- name: Always run
run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped."

0 comments on commit 486e96b

Please sign in to comment.