Skip to content

Commit

Permalink
Merge branch 'test2' into test3
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Apr 5, 2024
2 parents 89d2a32 + 6942e84 commit 9871e2c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ jobs:
ATTEMPTS: ${{ github.event.workflow_run.run_attempt }}
with:
script: |
const fs = require('fs');
const path = require('path');
// Load the JSON content
const contentPath = path.join(process.env.GITHUB_WORKSPACE, 'downloaded_artifacts', 'gh-status.json');
const contentJSON = JSON.parse(fs.readFileSync(contentPath));
const contentJSON = require('./downloaded_artifacts/gh-status.json');
const { job_name: JOB_NAME, context: CUSTOM_CONTEXT = 'Custom CI Status Check', description: CUSTOM_DESCRIPTION = 'Custom CI Status description', target_url: CUSTOM_TARGET_URL, state: CUSTOM_STATE = 'success' } = contentJSON;
// Fetch the first job ID from the workflow run
Expand All @@ -60,10 +56,13 @@ jobs:
// Set default target URL if not defined
const targetUrl = CUSTOM_TARGET_URL || `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.WORKFLOW_RUN_ID}/attempts/${process.env.ATTEMPTS}#summary-${JOB_ID}`;
console.log(CUSTOM_STATE);
console.log(targetUrl);
console.log(CUSTOM_DESCRIPTION);
console.log(CUSTOM_CONTEXT);
console.log("job id: ", JOB_ID);
console.log("state: ", CUSTOM_STATE);
console.log("target url: ", targetUrl);
console.log("description: ", CUSTOM_DESCRIPTION);
console.log("context: ", CUSTOM_CONTEXT);
// Create status
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
Expand Down

0 comments on commit 9871e2c

Please sign in to comment.