Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
userdocs committed Jan 1, 2025
1 parent e8fe1fa commit 95dd121
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-alpine-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ jobs:
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
fi
- name: Docker - Copy repo patches to build folder ${{ inputs.distinct_id }}
if: env.disable_qt5 != 'yes'
run: if [[ -d patches ]]; then docker exec -w /root multiarch cp -r patches/* /root/${{ env.qbt_build_dir }}/patches; fi
# - name: Docker - Copy repo patches to build folder ${{ inputs.distinct_id }}
# if: env.disable_qt5 != 'yes'
# run: if [[ -d patches ]]; then docker exec -w /root multiarch cp -r patches/* /root/${{ env.qbt_build_dir }}/patches; fi

- name: Docker - zlib-ng ${{ inputs.distinct_id }}
if: env.disable_qt5 != 'yes'
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/ci-auto-rerun-failed-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
retries:
description: "The number of retries to rerun the workflow"
required: true
github_repo:
description: "The repository to rerun the workflow"
required: true
distinct_id:
description: "The distinct id of the workflow to rerun"
required: false

jobs:
gh-cli-rerun:
Expand All @@ -20,21 +26,25 @@ jobs:
actions: write
runs-on: ubuntu-latest
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GH_TOKEN: "${{ secrets.PERSONAL_TOKEN || github.token }}"
steps:
- name: Host - Checkout action
- name: Host - Checkout action ${{ inputs.distinct_id }}
uses: actions/checkout@v4

- name: gh cli rerun and summaries
- name: gh cli rerun and summaries ${{ inputs.distinct_id }}
if: inputs.attempts <= inputs.retries
run: |
failures="$(gh run view ${{ inputs.run_id }} --log-failed | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")"
[[ -z "${failures}" ]] && failures="$(gh run view ${{ inputs.run_id }} | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")"
github_repo="${{ inputs.github_repo || github.repository }}"
failures="$(gh run view ${{ inputs.run_id }} --log-failed --repo "${github_repo}" | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")"
if [[ -z "${failures}" ]]; then
failures="$(gh run view ${{ inputs.run_id }} --repo "${github_repo}" | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")"
fi
if [[ "${{ inputs.retries }}" -ge "2" ]]; then
gh run rerun "${{ inputs.run_id }}" --failed --debug
gh run rerun "${{ inputs.run_id }}" --failed --debug --repo "${github_repo}"
else
gh run rerun "${{ inputs.run_id }}" --failed
gh run rerun "${{ inputs.run_id }}" --failed --repo "${github_repo}"
fi
printf '%b\n' "# gh cli workflow reruns" >> $GITHUB_STEP_SUMMARY
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci-main-reusable-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ jobs:
actions: write
runs-on: ubuntu-latest
env:
GH_TOKEN: "${{ github.token }}"
GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}"
steps:
- uses: actions/checkout@v4
- name: Trigger rerun workflow on job failures
run: |
inputs_retries="${{ github.event.inputs.retries }}"
gh workflow run ci-auto-rerun-failed-jobs.yml -f run_id=${{ github.run_id }} -f attempts=${{ github.run_attempt }} -f retries=${inputs_retries:-1}
gh workflow run ci-auto-rerun-failed-jobs.yml --repo "${{ env.github_repo || github.repository }}" -f run_id=${{ github.run_id }} -f attempts=${{ github.run_attempt }} -f retries=${inputs_retries:-1} -f github_repo=${{ github.repository }} -f distinct_id=${{ github.event.inputs.distinct_id }}

0 comments on commit 95dd121

Please sign in to comment.