From cc3ced120cdb83b144f9c19d338cb354d15442e8 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sat, 23 Sep 2023 19:40:10 -0400 Subject: Move actions and scripts to separate reusable repos Add `extension/deps/SCsub` --- .github/actions/openvic-env/commit-environment.js | 30 ----------------------- 1 file changed, 30 deletions(-) delete mode 100644 .github/actions/openvic-env/commit-environment.js (limited to '.github/actions/openvic-env/commit-environment.js') diff --git a/.github/actions/openvic-env/commit-environment.js b/.github/actions/openvic-env/commit-environment.js deleted file mode 100644 index f6213c2..0000000 --- a/.github/actions/openvic-env/commit-environment.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = async ({github, context, core}) => { - const commit_name = 'OPENVIC_COMMIT'; - const tag_name = 'OPENVIC_TAG'; - const release_name = 'OPENVIC_RELEASE'; - var commit_sha = process.env["GITHUB_SHA"]; - - if(context.eventName === 'pull_request') { - commit_sha = context.payload.pull_request.head.sha; - } - - core.exportVariable(commit_name, commit_sha); - - try { - const release = await github.rest.repos.getLatestRelease({owner: context.repo.owner, repo: context.repo.repo}); - core.exportVariable(tag_name, release.data["tag_name"]); - core.exportVariable(release_name, release.data["name"]); - } catch(error) { - if (error.response.status != 404) throw error; - - const tagList = await github.rest.repos.listTags({owner: context.repo.owner, repo: context.repo.repo}); - if (tagList.data.length == 0) { - core.warning("Could not list tags, this repo has no tags on it, setting tag_name and release_name environment variables to '' and '', you can fetch tags with 'git fetch --tags' ' and push tags with 'git push --tags"); - core.exportVariable(tag_name, `<${context.repo.owner}/${context.repo.repo}-NoTag>`); - core.exportVariable(release_name, `<${context.repo.owner}/${context.repo.repo}-NoRelease>`); - } else { - core.exportVariable(tag_name, tagList.data[0].name); - core.exportVariable(release_name, tagList.data[0].name); - } - } -} \ No newline at end of file -- cgit v1.2.3-56-ga3b1