From e79c791153c6a77827da45fae4185a4a9581eedf Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:28:30 -0400 Subject: [PATCH 1/8] add check-name input to review check --- .github/workflows/review.yml | 13 +++++++++++++ post-review-status/action.yml | 3 +++ src/post-review-status.ts | 7 +++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 2ecba2f..e76f2aa 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -27,3 +27,16 @@ jobs: pull-request: ${{ github.event.pull_request.number }} owner: ${{ github.repository_owner }} repo: github-actions + check-name: review + + test-post-typescript-v2-review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: security-review + uses: ./post-review-status + with: + pull-request: ${{ github.event.pull_request.number }} + owner: ${{ github.repository_owner }} + repo: github-actions + check-name: typescript-v2 diff --git a/post-review-status/action.yml b/post-review-status/action.yml index 947c6db..7645773 100644 --- a/post-review-status/action.yml +++ b/post-review-status/action.yml @@ -16,6 +16,9 @@ inputs: pull-request: description: Pull-request number required: false + check-name: + description: Name of the check. If not provided, the repository name will be used. + required: false outputs: result: description: "Commit status details" diff --git a/src/post-review-status.ts b/src/post-review-status.ts index e10c919..e44dd50 100644 --- a/src/post-review-status.ts +++ b/src/post-review-status.ts @@ -10,6 +10,7 @@ async function main(): Promise { const owner = core.getInput("owner"); const repo = core.getInput("repo"); + const checkName = core.getInput("check-name"); let pr_num = core.getInput("pull-request"); if (pr_num == "") @@ -49,6 +50,8 @@ async function main(): Promise { status = "failure"; } } + const contextName = checkName ? checkName : context.repo.repo; + return github.rest.repos.createCommitStatus({ owner: owner, repo: repo, @@ -57,10 +60,10 @@ async function main(): Promise { target_url: `https://github.com/${context.repo.owner}/${ context.repo.repo }/pull/${context.payload.pull_request!.number}`, - description: `status of ${context.repo.owner}/${context.repo.repo}#${ + description: `status of ${context.repo.owner}/${contextName}#${ context.payload.pull_request!.number }`, - context: `${context.repo.repo}/review`, + context: `${contextName}/review`, }); } From 7f03f5c62287da6737d97dc468fce5de97e6f5da Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:36:56 -0400 Subject: [PATCH 2/8] temporarily remove first test --- .github/workflows/review.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index e76f2aa..653451a 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -17,18 +17,6 @@ on: - dismissed jobs: - test-post-review-status: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - id: review - uses: ./post-review-status - with: - pull-request: ${{ github.event.pull_request.number }} - owner: ${{ github.repository_owner }} - repo: github-actions - check-name: review - test-post-typescript-v2-review: runs-on: ubuntu-latest steps: From 7b089972d86d05c62bf3b6239ea414343480aed6 Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:40:04 -0400 Subject: [PATCH 3/8] add back test --- .github/workflows/review.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 653451a..e76f2aa 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -17,6 +17,18 @@ on: - dismissed jobs: + test-post-review-status: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: review + uses: ./post-review-status + with: + pull-request: ${{ github.event.pull_request.number }} + owner: ${{ github.repository_owner }} + repo: github-actions + check-name: review + test-post-typescript-v2-review: runs-on: ubuntu-latest steps: From 16a0506f3bb1a137b7b504c017b15bf68cc5fff5 Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:45:02 -0400 Subject: [PATCH 4/8] no check-name case --- .github/workflows/review.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index e76f2aa..76b93ff 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -27,7 +27,6 @@ jobs: pull-request: ${{ github.event.pull_request.number }} owner: ${{ github.repository_owner }} repo: github-actions - check-name: review test-post-typescript-v2-review: runs-on: ubuntu-latest From 0673ee377a6f7ec8f825790975c3d8635300f49d Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:46:14 -0400 Subject: [PATCH 5/8] change description --- lib/post-review-status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/post-review-status.js b/lib/post-review-status.js index e5c7291..c6c7d58 100644 --- a/lib/post-review-status.js +++ b/lib/post-review-status.js @@ -69,7 +69,7 @@ async function main() { sha: pr.head.sha, state: status, target_url: `https://github.com/${github_1.context.repo.owner}/${github_1.context.repo.repo}/pull/${github_1.context.payload.pull_request.number}`, - description: `status of ${github_1.context.repo.owner}/${github_1.context.repo.repo}#${github_1.context.payload.pull_request.number}`, + description: `this is the status of ${github_1.context.repo.owner}/${github_1.context.repo.repo}#${github_1.context.payload.pull_request.number}`, context: `${github_1.context.repo.repo}/review`, }); } From 05c350fc18aedf60599afb7e3c623452fc5b5278 Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 14:55:56 -0400 Subject: [PATCH 6/8] recompile typescript --- lib/post-review-status.js | 6 ++++-- lib/post-review-status.js.map | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/post-review-status.js b/lib/post-review-status.js index c6c7d58..3f49911 100644 --- a/lib/post-review-status.js +++ b/lib/post-review-status.js @@ -28,6 +28,7 @@ async function main() { const github = github_1.getOctokit(token, {}); const owner = core.getInput("owner"); const repo = core.getInput("repo"); + const checkName = core.getInput("check-name"); let pr_num = core.getInput("pull-request"); if (pr_num == "") pr_num = github_1.context.payload.pull_request.head.ref.split("/")[2]; @@ -63,14 +64,15 @@ async function main() { status = "failure"; } } + const contextName = checkName ? checkName : github_1.context.repo.repo; return github.rest.repos.createCommitStatus({ owner: owner, repo: repo, sha: pr.head.sha, state: status, target_url: `https://github.com/${github_1.context.repo.owner}/${github_1.context.repo.repo}/pull/${github_1.context.payload.pull_request.number}`, - description: `this is the status of ${github_1.context.repo.owner}/${github_1.context.repo.repo}#${github_1.context.payload.pull_request.number}`, - context: `${github_1.context.repo.repo}/review`, + description: `status of ${github_1.context.repo.owner}/${contextName}#${github_1.context.payload.pull_request.number}`, + context: `${contextName}/review`, }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/lib/post-review-status.js.map b/lib/post-review-status.js.map index a168d41..d47541f 100644 --- a/lib/post-review-status.js.map +++ b/lib/post-review-status.js.map @@ -1 +1 @@ -{"version":3,"file":"post-review-status.js","sourceRoot":"","sources":["../src/post-review-status.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,4CAAsD;AAEtD,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AAC9C,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,mBAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAErC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEnC,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,MAAM,IAAI,EAAE;QACd,MAAM,GAAG,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAW,CAAC;IAE1E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,MAAM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QAC1C,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG;QAChB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,sBAAsB,gBAAO,CAAC,IAAI,CAAC,KAAK,IAClD,gBAAO,CAAC,IAAI,CAAC,IACf,SAAS,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAAM,EAAE;QAC/C,WAAW,EAAE,aAAa,gBAAO,CAAC,IAAI,CAAC,KAAK,IAAI,WAAW,IACzD,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAChC,EAAE;QACF,OAAO,EAAE,GAAG,WAAW,SAAS;KACjC,CAAC,CAAC;AACL,CAAC;AAED,8DAA8D;AAC9D,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file From 7e2c0406834dcfcd5018c4b7c3c0f9bc7ca2e74b Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 15:57:54 -0400 Subject: [PATCH 7/8] update status-check action, description, and clean up syntax --- .github/workflows/review.yml | 4 ++-- .github/workflows/test.yml | 13 +++++++++++++ lib/post-review-status.js | 2 +- lib/post-review-status.js.map | 2 +- lib/post-status-check.js | 4 +++- lib/post-status-check.js.map | 2 +- post-review-status/action.yml | 2 +- post-status-check/action.yml | 3 +++ src/post-review-status.ts | 2 +- src/post-status-check.ts | 6 +++++- 10 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 76b93ff..74b81cb 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -28,7 +28,7 @@ jobs: owner: ${{ github.repository_owner }} repo: github-actions - test-post-typescript-v2-review: + test-post-status-check-feature-branch: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -38,4 +38,4 @@ jobs: pull-request: ${{ github.event.pull_request.number }} owner: ${{ github.repository_owner }} repo: github-actions - check-name: typescript-v2 + check-name: github-actions/important-feature-branch diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0eb5e81..d02223f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,3 +22,16 @@ jobs: pull-request: ${{ github.event.pull_request.number }} owner: ${{ github.repository_owner }} repo: github-actions + + test-post-status-check-feature-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: status + uses: ./post-status-check + with: + context: action + pull-request: ${{ github.event.pull_request.number }} + owner: ${{ github.repository_owner }} + repo: github-actions + check-name: github-actions/important-feature-branch diff --git a/lib/post-review-status.js b/lib/post-review-status.js index 3f49911..2086d71 100644 --- a/lib/post-review-status.js +++ b/lib/post-review-status.js @@ -64,7 +64,7 @@ async function main() { status = "failure"; } } - const contextName = checkName ? checkName : github_1.context.repo.repo; + const contextName = checkName || github_1.context.repo.repo; return github.rest.repos.createCommitStatus({ owner: owner, repo: repo, diff --git a/lib/post-review-status.js.map b/lib/post-review-status.js.map index d47541f..8a216f9 100644 --- a/lib/post-review-status.js.map +++ b/lib/post-review-status.js.map @@ -1 +1 @@ -{"version":3,"file":"post-review-status.js","sourceRoot":"","sources":["../src/post-review-status.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,4CAAsD;AAEtD,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AAC9C,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,mBAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAErC,MA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AAE,CAAC,CAAC;QACpC,IAAI,MAAM,KAAK,UAAU,EAAE;YACzB,MAAM,GAAG,SAAS,CAAC;SACpB;aAAM,IAAI,MAAM,KAAK,mBAAmB,EAAE;YACzC,MAAM,GAAG,SAAS,CAAC;SACpB;KACF;IACD,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAE9D,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG;QAChB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,sBAAsB,gBAAO,CAAC,IAAI,CAAC,KAAK,IAClD,gBAAO,CAAC,IAAI,CAAC,IACf,SAAS,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAAM,EAAE;QAC/C,WAAW,EAAE,aAAa,gBAAO,CAAC,IAAI,CAAC,KAAK,IAAI,WAAW,IACzD,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAChC,EAAE;QACF,OAAO,EAAE,GAAG,WAAW,SAAS;KACjC,CAAC,CAAC;AACL,CAAC;AAED,8DAA8D;AAC9D,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file +{"version":3,"file":"post-review-status.js","sourceRoot":"","sources":["../src/post-review-status.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,4CAAsD;AAEtD,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AAC9C,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE1B,KAAK,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YAAa,CAAC,OAAO,CAAC;QACpD,MAAM,KAAK,GAAG;wBACM,KAAK;;;;;UAKnB,CAAC;QACP,MAAM,EACJ,IAAI,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GACjC,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,IAAI,MAAM,KAAK,UAAU,EAAE;YACzB,MAAM,GAAG,SAAS,CAAC;SACpB;aAAM,IAAI,MAAM,KAAK,mBAAmB,EAAE;YACzC,MAAM,GAAG,SAAS,CAAC;SACpB;KACF;IACD,MAAM,WAAW,GAAG,SAAS,IAAI,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAEnD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG;QAChB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,sBAAsB,gBAAO,CAAC,IAAI,CAAC,KAAK,IAClD,gBAAO,CAAC,IAAI,CAAC,IACf,SAAS,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAAM,EAAE;QAC/C,WAAW,EAAE,aAAa,gBAAO,CAAC,IAAI,CAAC,KAAK,IAAI,WAAW,IACzD,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAChC,EAAE;QACF,OAAO,EAAE,GAAG,WAAW,SAAS;KACjC,CAAC,CAAC;AACL,CAAC;AAED,8DAA8D;AAC9D,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/lib/post-status-check.js b/lib/post-status-check.js index 1e14ae9..c35ef56 100644 --- a/lib/post-status-check.js +++ b/lib/post-status-check.js @@ -28,6 +28,7 @@ async function main() { const github = github_1.getOctokit(token, {}); const owner = core.getInput("owner"); const repo = core.getInput("repo"); + const checkName = core.getInput("check-name"); let pr_num = core.getInput("pull-request"); if (pr_num == "") pr_num = github_1.context.payload.pull_request.head.ref.split("/")[2]; @@ -41,6 +42,7 @@ async function main() { repo: github_1.context.repo.repo, run_id: github_1.context.runId, }); + const contextName = checkName || github_1.context.repo.repo; return github.rest.repos.createCommitStatus({ owner: owner, repo: repo, @@ -48,7 +50,7 @@ async function main() { state: core.getInput("status"), target_url: `https://github.com/${github_1.context.repo.owner}/${github_1.context.repo.repo}/pull/${github_1.context.payload.pull_request.number}/checks?check_run_id=${jobs.jobs[0].id}`, description: github_1.context.workflow, - context: `${github_1.context.repo.repo}/${core.getInput("context")}`, + context: `${contextName}/${core.getInput("context")}`, }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/lib/post-status-check.js.map b/lib/post-status-check.js.map index b602d85..3effc04 100644 --- a/lib/post-status-check.js.map +++ b/lib/post-status-check.js.map @@ -1 +1 @@ -{"version":3,"file":"post-status-check.js","sourceRoot":"","sources":["../src/post-status-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,4CAAsD;AAEtD,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AAC9C,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,mBAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAErC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEnC,I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AI;QACV,WAAW,EAAE,CAAC,MAAM;KACrB,CAAC,CAAC;IACH,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;QACtE,KAAK,EAAE,gBAAO,CAAC,IAAI,CAAC,KAAK;QACzB,IAAI,EAAE,gBAAO,CAAC,IAAI,CAAC,IAAI;QACvB,MAAM,EAAE,gBAAO,CAAC,KAAK;KACtB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,SAAS,IAAI,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAEnD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG;QAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAIhB;QACb,UAAU,EAAE,sBAAsB,gBAAO,CAAC,IAAI,CAAC,KAAK,IAClD,gBAAO,CAAC,IAAI,CAAC,IACf,SAAS,gBAAO,CAAC,OAAO,CAAC,YAAa,CAAC,MAAM,wBAC3C,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACf,EAAE;QACF,WAAW,EAAE,gBAAO,CAAC,QAAQ;QAC7B,OAAO,EAAE,GAAG,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;KACtD,CAAC,CAAC;AACL,CAAC;AAED,8DAA8D;AAC9D,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,IAAI,CAAC,SAAS,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/post-review-status/action.yml b/post-review-status/action.yml index 7645773..775ba85 100644 --- a/post-review-status/action.yml +++ b/post-review-status/action.yml @@ -17,7 +17,7 @@ inputs: description: Pull-request number required: false check-name: - description: Name of the check. If not provided, the repository name will be used. + description: Prefix for the status check name. If not provided, the repository name will be used. required: false outputs: result: diff --git a/post-status-check/action.yml b/post-status-check/action.yml index 7dd3dcc..3a61956 100644 --- a/post-status-check/action.yml +++ b/post-status-check/action.yml @@ -19,6 +19,9 @@ inputs: context: description: Name of the status check required: true + check-name: + description: Prefix for the status check name. If not provided, the repository name will be used. + required: false status: description: A valid status value for the commit default: "success" diff --git a/src/post-review-status.ts b/src/post-review-status.ts index e44dd50..3931b64 100644 --- a/src/post-review-status.ts +++ b/src/post-review-status.ts @@ -50,7 +50,7 @@ async function main(): Promise { status = "failure"; } } - const contextName = checkName ? checkName : context.repo.repo; + const contextName = checkName || context.repo.repo; return github.rest.repos.createCommitStatus({ owner: owner, diff --git a/src/post-status-check.ts b/src/post-status-check.ts index 7bdd4fd..fc299c1 100644 --- a/src/post-status-check.ts +++ b/src/post-status-check.ts @@ -10,6 +10,7 @@ async function main(): Promise { const owner = core.getInput("owner"); const repo = core.getInput("repo"); + const checkName = core.getInput("check-name"); let pr_num = core.getInput("pull-request"); if (pr_num == "") @@ -25,6 +26,9 @@ async function main(): Promise { repo: context.repo.repo, run_id: context.runId, }); + + const contextName = checkName || context.repo.repo; + return github.rest.repos.createCommitStatus({ owner: owner, repo: repo, @@ -40,7 +44,7 @@ async function main(): Promise { jobs.jobs[0].id }`, description: context.workflow, - context: `${context.repo.repo}/${core.getInput("context")}`, + context: `${contextName}/${core.getInput("context")}`, }); } From db4b98a773662d0162dd81ed83907983c98b088a Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Wed, 25 Jun 2025 15:59:18 -0400 Subject: [PATCH 8/8] yaml formatting --- .github/workflows/test.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d02223f..25587b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,15 +23,15 @@ jobs: owner: ${{ github.repository_owner }} repo: github-actions - test-post-status-check-feature-branch: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - id: status - uses: ./post-status-check - with: - context: action - pull-request: ${{ github.event.pull_request.number }} - owner: ${{ github.repository_owner }} - repo: github-actions - check-name: github-actions/important-feature-branch + test-post-status-check-feature-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: status + uses: ./post-status-check + with: + context: action + pull-request: ${{ github.event.pull_request.number }} + owner: ${{ github.repository_owner }} + repo: github-actions + check-name: github-actions/important-feature-branch