Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@azu
Last activeJanuary 6, 2023 06:28
    • Star(3)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist
    Save azu/533a1cfb83e1040d77b6963c9004856d to your computer and use it in GitHub Desktop.

    Revisions

    1. azu revised this gistJan 5, 2023.1 changed file with0 additions and2 deletions.
      2 changes: 0 additions & 2 deletionsall-env-circleci.mjs
      View file
      Original file line numberDiff line numberDiff line change
      @@ -13,8 +13,6 @@ const fetchProjectEnv = (orgName, project) => {
      }).then(res=>res.json());
      }
      constprojectNames=awaitfetchProjectList();
      console.log(projectNames.length);

      constprojectMap=newMap()
      for(constprojectNameofprojectNames){
      constenv=awaitfetchProjectEnv(ORG_NAME,projectName);
    2. azu revised this gistJan 5, 2023.1 changed file with1 addition and1 deletion.
      2 changes: 1 addition & 1 deletionall-env-circleci.mjs
      View file
      Original file line numberDiff line numberDiff line change
      @@ -1,4 +1,4 @@
      importfetchfrom"node-fetch";
      importfetchfrom"node-fetch";// Node.js 18 just remove line

      constCIRCLECI_TOKEN=process.env.CIRCLECI_TOKEN
      constORG_NAME=process.env.ORG_NAME
    3. azu created this gistJan 5, 2023.
      24 changes: 24 additions & 0 deletionsall-env-circleci.mjs
      View file
      Original file line numberDiff line numberDiff line change
      @@ -0,0 +1,24 @@
      importfetchfrom"node-fetch";

      constCIRCLECI_TOKEN=process.env.CIRCLECI_TOKEN
      constORG_NAME=process.env.ORG_NAME
      constfetchProjectList=(orgName=ORG_NAME)=>{
      returnfetch(`https://circleci.com/api/v2/insights/gh/${orgName}/summary`,{
      headers:{"Circle-Token":`${CIRCLECI_TOKEN}`}
      }).then(res=>res.json()).then(json=>json.all_projects);
      };
      constfetchProjectEnv=(orgName,project)=>{
      returnfetch(`https://circleci.com/api/v2/project/gh/${orgName}/${project}/envvar`,{
      headers:{"Circle-Token":`${CIRCLECI_TOKEN}`}
      }).then(res=>res.json());
      }
      constprojectNames=awaitfetchProjectList();
      console.log(projectNames.length);

      constprojectMap=newMap()
      for(constprojectNameofprojectNames){
      constenv=awaitfetchProjectEnv(ORG_NAME,projectName);
      projectMap.set(projectName,env.items);
      }

      console.log(JSON.stringify(Array.from((projectMap.entries()))))

    [8]ページ先頭

    ©2009-2025 Movatter.jp