Skip to content

Commit 0b31d41

Browse files
wip
1 parent b8ff0f9 commit 0b31d41

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# General: "needs-robot-testing" and "robot-tested" should be the default values of two inputs.
2-
# 1. It should check if "needs-robot-testing" label is present.
3-
# 2. It should check if "robot-tested" label is present.
4-
# 3. If "needs-robot-testing" is present and "robot-tested" is not present, it should fail with an error message saying "PR needs robot testing but is not marked as robot-tested."
1+
# General: "robot-test-needed" and "robot-test-done" should be the default values of two inputs.
2+
# 1. It should check if "robot-test-needed" label is present.
3+
# 2. It should check if "robot-test-done" label is present.
4+
# 3. If "robot-test-needed" is present and "robot-test-done" is not present, it should fail with an error message saying "PR needs robot testing but is not marked as robot-test-done."

.github/actions/test-label/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
name: "Test Label"
2-
description: "Checks if the robot-tested label is present on the PR and adds a confirming comment."
2+
description: "Checks if the robot-test-done label is present on the PR and adds a confirming comment."
33

44
inputs:
5-
label-robot-tested:
6-
description: 'Label name indicating the PR has been robot-tested'
5+
label-robot-test-done:
6+
description: 'Label name indicating the PR has been robot-test-done'
77
required: false
8-
default: 'robot-tested'
8+
default: 'robot-test-done'
99

1010
runs:
1111
using: "composite"
1212
steps:
13-
- name: Check robot-tested label and add comment
13+
- name: Check robot-test-done label and add comment
1414
shell: bash
1515
env:
1616
GH_TOKEN: ${{ github.token }}
1717
PR_NUMBER: ${{ github.event.pull_request.number }}
1818
REPO: ${{ github.repository }}
1919
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
20-
LABEL_ROBOT_TESTED: ${{ inputs.label-robot-tested }}
20+
LABEL_ROBOT_TESTED: ${{ inputs.label-robot-test-done }}
2121
run: |
2222
LABELS=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json labels --jq '.labels[].name')
2323

.github/actions/test-unlabel/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: "Test Unlabel"
2-
description: "Removes the robot-tested label from the PR if present and adds a comment."
2+
description: "Removes the robot-test-done label from the PR if present and adds a comment."
33

44
inputs:
55
label-robot-test-needed:
66
description: 'Label name indicating the PR needs robot testing'
77
required: false
8-
default: 'needs-robot-testing'
9-
label-robot-tested:
10-
description: 'Label name indicating the PR has been robot-tested'
8+
default: 'robot-test-needed'
9+
label-robot-test-done:
10+
description: 'Label name indicating the PR has been robot-test-done'
1111
required: false
12-
default: 'robot-tested'
12+
default: 'robot-test-done'
1313

1414
runs:
1515
using: "composite"
1616
steps:
17-
- name: Remove robot-tested label and add comment
17+
- name: Remove robot-test-done label and add comment
1818
shell: bash
1919
env:
2020
GH_TOKEN: ${{ github.token }}
2121
PR_NUMBER: ${{ github.event.pull_request.number }}
2222
REPO: ${{ github.repository }}
2323
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
24-
LABEL_ROBOT_TESTED: ${{ inputs.label-robot-tested }}
24+
LABEL_ROBOT_TESTED: ${{ inputs.label-robot-test-done }}
2525
LABEL_ROBOT_TEST_NEEDED: ${{ inputs.label-robot-test-needed }}
2626
run: |
2727
LABELS=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json labels --jq '.labels[].name')

.github/workflows/pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ permissions:
1515

1616
jobs:
1717
test-label:
18-
if: github.event.label.name == 'robot-tested'
18+
if: github.event.label.name == 'robot-test-done'
1919
name: Test Label
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Test Label Added
2323
uses: ./.github/actions/test-unlabel
2424
with:
25-
label-robot-tested: robot-tested
25+
label-robot-test-done: robot-test-done
2626

2727
test-unlabel:
2828
if: github.event.action == 'synchronize'
@@ -32,8 +32,8 @@ jobs:
3232
- name: Remove Test Label
3333
uses: ./.github/actions/test-label
3434
with:
35-
label-robot-tested: robot-tested
36-
label-robot-test-needed: needs-robot-testing
35+
label-robot-test-done: robot-test-done
36+
label-robot-test-needed: robot-test-needed
3737

3838
build:
3939
needs: test-unlabel

0 commit comments

Comments
 (0)