Skip to content

Commit

Permalink
Update GH Action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
VaniHaripriya committed Oct 7, 2024
1 parent 79a6893 commit dc26665
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# 1. Resets the 'ci-passed' label status when a pull request is synchronized or reopened,
# indicating that changes have been pushed and CI needs to rerun.
# 2. Polls every 5 minutes to check if all CI checks have passed.
# 3. Adds the 'ci-passed' label to the pull request if all CI checks pass successfully.

name: Check CI Completion
name: CI Check

on:
pull_request:
Expand Down Expand Up @@ -37,11 +36,5 @@ jobs:
delay: '5'
retries: '7'
polling_interval: '5'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add 'ci-passed' label
if: success()
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/labeling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow adds the 'ci-passed' label to a pull request once the 'CI Check' workflow completes successfully.

name: Labeling Workflow

on:
workflow_run:
workflows: ["CI Check"]
types:
- completed

permissions:
pull-requests: write
checks: read

jobs:
add_ci_passed_label:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Add 'ci-passed' label
run: |
gh pr edit ${{ github.event.workflow_run.pull_requests[0].number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dc26665

Please sign in to comment.