Skip to content

Commit

Permalink
add script to initialize .dev.vars in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad committed Mar 26, 2024
1 parent d4c9582 commit cf025a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions e2e/publish.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import wp from "wait-port";
import assert from "node:assert";
import ezSpawn from "@jsdevtools/ez-spawn";
import { objectHash, sha256 } from "ohash";

import kill from 'kill-port'
import workflowJobQueuedFixture from './fixtures/workflow_job.queued.json' with {type: 'json'}

Expand Down
14 changes: 12 additions & 2 deletions packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (!process.env.TEST && process.env.GITHUB_ACTIONS !== "true") {
);
process.exit(1);
}
const octokit = new Octokit();

const {
GITHUB_SERVER_URL,
Expand All @@ -38,8 +39,17 @@ const {
GITHUB_SHA,
} = process.env;

const [owner, repo] = GITHUB_REPOSITORY.split("/");

const commit = await octokit.git.getCommit({
owner,
repo,
commit_sha: GITHUB_SHA,
});
console.log("commit", commit);

// Note: If you need to use a workflow run's URL from within a job, you can combine these variables: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
const url = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;
const url = `${GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${GITHUB_RUN_ID}`;

const metadata = {
url,
Expand Down Expand Up @@ -90,7 +100,7 @@ const main = defineCommand({
);

const url = new URL(
`/${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}/${GITHUB_SHA}/${name}`,
`/${owner}/${repo}/${GITHUB_REF_NAME}/${GITHUB_SHA}/${name}`,
API_URL
);

Expand Down

0 comments on commit cf025a4

Please sign in to comment.