ms-teams-deploy-card icon indicating copy to clipboard operation
ms-teams-deploy-card copied to clipboard

Adding job-name in order to evaluate correct job_id/name

Open femrtnz opened this issue 4 years ago • 3 comments

Hi All,

Currently, when we set the value jobs.<job_id>.name this replaces the JOB NAME within workflowJobs.data.jobs list.

During the validation, we use the GITHUB_JOB environment variable to check the job, and this one does not change.

  const job = workflowJobs.data.jobs.find(
    (job: Octokit.ActionsListJobsForWorkflowRunResponseJobsItem) =>
      job.name === process.env.GITHUB_JOB
  );

...so the job returns null.

I also created this issue to investigate this problem: https://github.community/t/job-job-id-name-changes-job-id-field/121965

In order to keep this working with multiple jobs (explicit created or using strategy.matrix.spec) in the same workflow I suggest we create a new field job-name where you can customise the name and validate it correctly

Please let me know if this make sense.

Re #22

femrtnz avatar Jul 10 '20 12:07 femrtnz

Hi @femrtnz, thank you so much for the fix. Unfortunately, we must not redeclare the name of the job twice. I'm currently doing a fix now, and I see that GITHUB_JOB is not in the official document anymore. Moreover, I also see that @octokit/rest has changed a lot, so I'm upgrading it.

aldwyn-acn avatar Jul 10 '20 15:07 aldwyn-acn

Any progress on this?

jgrumboe avatar Dec 17 '20 09:12 jgrumboe

Hi all, any progress or updates on this?

rubiatoEJ avatar Mar 16 '22 01:03 rubiatoEJ