Skip to content

Commit

Permalink
Add quarkus-main rebase workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Mar 14, 2024
1 parent 00d923c commit 71e5552
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/quarkus-master-cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: quarkus-main rebase

on:
workflow_dispatch:
schedule:
# Run every day at 2AM
- cron: '0 2 * * *'

env:
LANG: en_US.UTF-8
ISSUE_ID: 1287

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
rebase-quarkus-main:
if: github.repository == 'quarkiverse/quarkus-cxf'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: rebase quarkus-main
run: |
echo "GH_ISSUE_STATE=closed" >> $GITHUB_ENV
set -e
git fetch origin
git checkout quarkus-main 2>/dev/null || git checkout -b quarkus-main
git rebase origin/main \
|| echo "GH_ISSUE_MESSAGE=Could not rebase ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV \
&& echo "GH_ISSUE_STATE=open" >> $GITHUB_ENV
- name: test the output
run: |
echo "${{ env.GH_ISSUE_MESSAGE }}"
echo "${{ env.GH_ISSUE_STATE }}"
- name: Report rebase failure in issue ${{ env.ISSUE_ID }}
if: env.GH_ISSUE_MESSAGE != ''
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ env.ISSUE_ID }}
body: |
${{ env.GH_ISSUE_MESSAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update the status of issue ${{ env.ISSUE_ID }}
run: |
curl --request PATCH \
--url ${{ github.api_url }}/repos/${{ github.repository }}/issues/${{ env.ISSUE_ID }} \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{"state": "${{ env.GH_ISSUE_STATE }}"}'
- name: Make the current workflow fail
if: env.GH_ISSUE_STATE == 'open'
run: |
exit 1

0 comments on commit 71e5552

Please sign in to comment.