Handling a change in the payload URL from CircleCI app#93
Handling a change in the payload URL from CircleCI app#93larsoner merged 31 commits intoscientific-python:masterfrom
Conversation
Removed header with credential info from step 1 fetch
Update index.js
…with a workflow that contains multiple jobs.
…t have been accessible outside.
Made changes to the action to support workflows with multiple jobs
Added logging for the entire payload to assist with debugging.
Log entire payload for debugging purposes
Updated logging to display payload keys instead of the entire payload for improved debugging.
Change payload logging to show only keys
Added comments to clarify the purpose of reading the 'state' from the payload.
Enhance comments for payload state handling
Bug/url format change
Added comment to detail the other type of GitHub app URL.
|
Could you please rebase on top of the default branch from here, this commit history is a bit confusing. Thanks! |
Sure, but hopefully the PR then has somewhat clean history, here it's not exactly clear to me from which commit the actual changes are coming from. |
dist/index.js
Outdated
| let artifacts_url = ''; | ||
| const target = payload.target_url.split('?')[0]; // strip any ?utm=… | ||
| if (target.includes('/pipelines/circleci/')) { | ||
| if (target.includes('/pipelines/circleci/') || target.includes('app.circleci.com/workflow/')) { |
There was a problem hiding this comment.
| if (target.includes('/pipelines/circleci/') || target.includes('app.circleci.com/workflow/')) { | |
| if (target.includes('/pipelines/circleci/') || target.includes('app.circleci.com/workflow/')) { |
In the end with the squash-and-merge approach the only commit in our |
A couple of weeks ago the format of the 'target_url' retrieved from the GitHub triggering event changed from the https://app.circleci.com/pipelines/circleci/... format, to a https://app.circleci.com/workflow/... format.
That was incompatible with the if statement used to decide how to construct the URL for retrieving artifacts.
I altered the if statement so that it would take the same approach for 'https://app.circleci.com/workflow/...' as it did/does for https://app.circleci.com/pipelines/circleci/...
Fixes the problems I was having in a project using this action, tested using my fork.