Skip to content

Commit

Permalink
Refactor CI for forked repositories - Fix (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanm authored Mar 23, 2024
1 parent 66a9750 commit afb871e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const github = require('@actions/github'); // @TODO move to 'imports from' when moved to TS !
const core = require('@actions/core');

const {GITHUB_REPOSITORY} = process.env;
// @TODO Find a way to retrieve current job (add the jobId as state to re-use it here !) and forward the annotations as Check run `details_text`

async function run() {
if (core.getState('check-run-already-concluded').length > 0) {
Expand All @@ -19,13 +19,11 @@ async function run() {
const requestParams = await core.group(
'Build API params',
async () => {
const [repoOwner, repoName] = GITHUB_REPOSITORY.split('/');

return {
conclusion: jobStatus,
// Url path parameters
owner: repoOwner,
repo: repoName,
owner: github.context.repo.owner,
repo: github.context.repo.repo,
check_run_id: checkRunId
};
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ export const getWorkflowName = () => ghaEvent.workflow.name;
/**
* @returns {string}
*/
export const getRunId = () => ghaEvent.workflow.id.toString();
export const getRunId = () => ghaEvent.workflow_run.id.toString();

0 comments on commit afb871e

Please sign in to comment.