From a32c6260399041eb93efe9f6c7d30507e88e6eb0 Mon Sep 17 00:00:00 2001 From: getdevopspro-cibot <203600057+getdevopspro-cibot@users.noreply.github.com> Date: Fri, 20 Feb 2026 07:59:49 -0600 Subject: [PATCH] refactor(test-label): handle unlabeled event --- .github/workflows/all-green.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/pull-request-label.yml | 2 +- .github/workflows/pull-request.yml | 16 +++++++++++----- .github/workflows/release.yml | 2 +- .github/workflows/test-robot-check.yml | 3 +-- .github/workflows/test-robot-label.yml | 15 ++++++++++----- ...t-robot-unlabel.yml => test-robot-remove.yml} | 14 +++++++------- 8 files changed, 33 insertions(+), 23 deletions(-) rename .github/workflows/{test-robot-unlabel.yml => test-robot-remove.yml} (70%) diff --git a/.github/workflows/all-green.yml b/.github/workflows/all-green.yml index 1293b16..5ad37db 100644 --- a/.github/workflows/all-green.yml +++ b/.github/workflows/all-green.yml @@ -11,4 +11,4 @@ jobs: - uses: actions/checkout@v4 - name: All Green - uses: getdevopspro/github-actions/all-green@v6.2.4 + uses: getdevopspro/github-actions/all-green@v6.3.2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0d6785..773302a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Build - uses: getdevopspro/github-actions/.github/workflows/build.yml@v6.2.4 + uses: getdevopspro/github-actions/.github/workflows/build.yml@v6.3.2 with: version-package: package.json version-package-lock: package-lock.json diff --git a/.github/workflows/pull-request-label.yml b/.github/workflows/pull-request-label.yml index 1d41a0e..0ff9494 100644 --- a/.github/workflows/pull-request-label.yml +++ b/.github/workflows/pull-request-label.yml @@ -2,7 +2,7 @@ name: PR - Label on: pull_request: - types: [labeled] + types: [labeled, unlabeled] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.label.name }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ad743ef..0bb0445 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,10 +15,9 @@ permissions: checks: read jobs: - test-robot-unlabel: - if: github.event.action == 'synchronize' + test-robot-remove: name: Job - uses: ./.github/workflows/test-robot-unlabel.yml + uses: ./.github/workflows/test-robot-remove.yml with: label-test-robot-done: test-robot-done label-test-robot-needed: test-robot-needed @@ -26,18 +25,25 @@ jobs: token: ${{ secrets.BOT_REPO_TOKEN }} build: - needs: test-robot-unlabel - if: ${{ !failure() && !cancelled() && needs.test-robot-unlabel.result != 'failure' }} + needs: test-robot-remove + if: ${{ !failure() && !cancelled() && needs.test-robot-remove.result != 'failure' }} name: Job uses: ./.github/workflows/build.yml + # runs-on: ubuntu-latest + # name: Build + # steps: + # - run: echo "Build step - replace with actual build commands" test-robot-check: needs: build + if: ${{ !cancelled() }} name: Job uses: ./.github/workflows/test-robot-check.yml with: label-test-robot-done: test-robot-done label-test-robot-needed: test-robot-needed + secrets: + token: ${{ secrets.BOT_REPO_TOKEN }} all-green: needs: test-robot-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 516bb67..e215c7f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: promote: name: Job needs: build - uses: getdevopspro/github-actions/.github/workflows/promote.yml@v6.2.4 + uses: getdevopspro/github-actions/.github/workflows/promote.yml@v6.3.2 secrets: # To bypass ruleset enforcing checks checkout-token: ${{ secrets.BOT_REPO_TOKEN }} diff --git a/.github/workflows/test-robot-check.yml b/.github/workflows/test-robot-check.yml index 2610769..286ab6f 100644 --- a/.github/workflows/test-robot-check.yml +++ b/.github/workflows/test-robot-check.yml @@ -24,14 +24,13 @@ permissions: jobs: test-robot-check-labels: - if: contains(github.event.pull_request.labels.*.name, inputs.label-test-robot-needed) || github.run_attempt > 1 name: Robot Test Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Robot Test Check - uses: getdevopspro/github-actions/test/check@v6.2.4 + uses: getdevopspro/github-actions/test/label/check@v6.3.2 with: label-done: ${{ inputs.label-test-robot-done }} label-needed: ${{ inputs.label-test-robot-needed }} diff --git a/.github/workflows/test-robot-label.yml b/.github/workflows/test-robot-label.yml index 5252f18..27c13ef 100644 --- a/.github/workflows/test-robot-label.yml +++ b/.github/workflows/test-robot-label.yml @@ -25,15 +25,19 @@ permissions: jobs: test-robot-label: - if: github.event.action == 'labeled' && - github.event.label.name == inputs['label-test-robot-done'] + if: > + github.event.label.name == inputs['label-test-robot-done'] || + github.event.label.name == inputs['label-test-robot-needed'] name: Robot Test Label runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Robot Test Label - uses: getdevopspro/github-actions/test/label@v6.2.4 + - name: Robot Test Done Label + if: > + github.event.action == 'labeled' && + github.event.label.name == inputs['label-test-robot-done'] + uses: getdevopspro/github-actions/test/label/done/added@v6.3.2 with: label-done: ${{ inputs.label-test-robot-done }} label-needed: ${{ inputs.label-test-robot-needed }} @@ -41,7 +45,8 @@ jobs: token: ${{ secrets.token }} - name: Rerun pull-request workflow - uses: getdevopspro/github-actions/pr/checks-rerun@v6.2.4 + uses: getdevopspro/github-actions/pr/job-rerun@v6.3.2 with: workflow-id: pull-request.yml token: ${{ secrets.token }} + job-name: "Job / Robot Test Check" diff --git a/.github/workflows/test-robot-unlabel.yml b/.github/workflows/test-robot-remove.yml similarity index 70% rename from .github/workflows/test-robot-unlabel.yml rename to .github/workflows/test-robot-remove.yml index 9101b32..bfbc9ee 100644 --- a/.github/workflows/test-robot-unlabel.yml +++ b/.github/workflows/test-robot-remove.yml @@ -1,4 +1,4 @@ -name: Robot Test Unlabel +name: Remove Robot Test on: workflow_call: @@ -23,15 +23,15 @@ permissions: pull-requests: write jobs: - test-robot-unlabel: - if: contains(github.event.pull_request.labels.*.name, inputs.label-test-robot-done) - name: Robot Test Unlabel - runs-on: ubuntu-latest| + test-robot-remove: + if: github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, inputs.label-test-robot-done) + name: Remove Robot Test + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Robot Test Unlabel - uses: getdevopspro/github-actions/test/unlabel@v6.2.4 + - name: Remove Robot Test Label + uses: getdevopspro/github-actions/test/label/done/remove@v6.3.2 with: label-done: ${{ inputs.label-test-robot-done }} label-needed: ${{ inputs.label-test-robot-needed }}