aboutsummaryrefslogtreecommitdiff
path: root/.github/actions/openvic2-env
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-05-16 23:49:52 +0200
committer Hop311 <hop3114@gmail.com>2023-05-17 13:47:02 +0200
commit578eb8c332810656842f72e0bb94bb0d4dcb9f5e (patch)
tree64dd37032c36da8e48d5d519ac840e11cc64dc58 /.github/actions/openvic2-env
parentaf6a96ed26bca3eaa28c6dca635918061fab7c80 (diff)
Changed from OpenVic2 to OpenVic
Diffstat (limited to '.github/actions/openvic2-env')
-rw-r--r--.github/actions/openvic2-env/action.yml33
1 files changed, 0 insertions, 33 deletions
diff --git a/.github/actions/openvic2-env/action.yml b/.github/actions/openvic2-env/action.yml
deleted file mode 100644
index 8fea1b3..0000000
--- a/.github/actions/openvic2-env/action.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Setup OpenVic2 Environment
-description: Setup OpenVic2 Environment
-runs:
- using: "composite"
- steps:
- - name: Setup Environment
- uses: actions/github-script@v6
- with:
- script: |
- const commit_name = 'OPENVIC2_COMMIT';
- const tag_name = 'OPENVIC2_TAG';
- const release_name = 'OPENVIC2_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 '<UserRepo-NoTag>' and '<UserRepo-NoRelease>', you can fetch tags with 'git fetch --tags' <remote-name>' 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