Skip to content

Commit 3e58112

Browse files
DavidT3autofix-ci[bot]David Turner
authored
Handling a change in the payload URL from CircleCI app (#93)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: David Turner <turne540@msu.edu>
1 parent f216db0 commit 3e58112

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

dist/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35852,6 +35852,9 @@ async function run() {
3585235852
core.debug(`Ignoring context: ${payload.context}`)
3585335853
return
3585435854
}
35855+
35856+
// Read out 'state' (whether CircleCI process was successful or not), then
35857+
// store in debug output along with the target_url
3585535858
const state = payload.state
3585635859
core.debug(`context: ${payload.context}`)
3585735860
core.debug(`state: ${state}`)
@@ -35861,9 +35864,11 @@ async function run() {
3586135864
// Set the new status
3586235865
let artifacts_url = '';
3586335866
const target = payload.target_url.split('?')[0]; // strip any ?utm=…
35864-
if (target.includes('/pipelines/circleci/')) {
35867+
if (target.includes('/pipelines/circleci/') || target.includes('app.circleci.com/workflow/')) {
3586535868
// ───── New GitHub‑App URL ───────────────────────────────────────────
3586635869
// .../pipelines/circleci/<org‑id>/<project‑id>/<pipe‑seq>/workflows/<workflow‑id>
35870+
// OR
35871+
// .../workflow/<workflow-id>
3586735872
const workflowId = target.split('/').pop();
3586835873
core.debug(`workflow: ${workflowId}`);
3586935874

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ async function run() {
3535
core.debug(`Ignoring context: ${payload.context}`)
3636
return
3737
}
38+
39+
// Read out 'state' (whether CircleCI process was successful or not), then
40+
// store in debug output along with the target_url
3841
const state = payload.state
3942
core.debug(`context: ${payload.context}`)
4043
core.debug(`state: ${state}`)
@@ -44,9 +47,11 @@ async function run() {
4447
// Set the new status
4548
let artifacts_url = '';
4649
const target = payload.target_url.split('?')[0]; // strip any ?utm=…
47-
if (target.includes('/pipelines/circleci/')) {
50+
if (target.includes('/pipelines/circleci/') || target.includes('app.circleci.com/workflow/')) {
4851
// ───── New GitHub‑App URL ───────────────────────────────────────────
4952
// .../pipelines/circleci/<org‑id>/<project‑id>/<pipe‑seq>/workflows/<workflow‑id>
53+
// OR
54+
// .../workflow/<workflow-id>
5055
const workflowId = target.split('/').pop();
5156
core.debug(`workflow: ${workflowId}`);
5257

0 commit comments

Comments
 (0)