Skip to content

Commit

Permalink
Merge pull request #161 from act10ns/use-envvars-as-fallback
Browse files Browse the repository at this point in the history
Fix schedule and manual jobs by falling back to envvars
  • Loading branch information
satterly authored Nov 13, 2020
2 parents ddd0517 + 9bd1c04 commit 0c47439
Show file tree
Hide file tree
Showing 7 changed files with 6,975 additions and 22,579 deletions.
7 changes: 6 additions & 1 deletion __tests__/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ github.context.workflow = dump.workflow
github.context.action = dump.action
github.context.actor = dump.actor

process.env.GITHUB_SHA = dump.sha
process.env.GITHUB_SERVER_URL = 'https://github.com'
process.env.GITHUB_REF = dump.ref
process.env.GITHUB_REPOSITORY = dump.repository

test('create event to slack', async () => {
const mockAxios = new MockAdapter(axios, {delayResponse: 200})

Expand Down Expand Up @@ -51,7 +56,7 @@ test('create event to slack', async () => {
author_icon: 'https://avatars0.githubusercontent.com/u/615057?v=4',
mrkdwn_in: ['text'],
text:
'*<https://github.com/act10ns/slack/commit/d0d4530a505a87990b764d11f207ea0e8c6e93f7/checks|Workflow _build-test_ job _Build and Test_ triggered by _create_ is _Success_>* for <https://github.com/act10ns/slack/commit/d0d4530a505a87990b764d11f207ea0e8c6e93f7|`fix-undefined-url`>\n<https://github.com/act10ns/slack/commit/d0d4530a505a87990b764d11f207ea0e8c6e93f7|`d0d4530a`> - new branch or tag',
'*<https://github.com/act10ns/slack/commit/d0d4530a505a87990b764d11f207ea0e8c6e93f7/checks|Workflow _build-test_ job _Build and Test_ triggered by _create_ is _Success_>* for <https://github.com/act10ns/slack/commits/fix-undefined-url|`fix-undefined-url`>\n<https://github.com/act10ns/slack/commit/d0d4530a505a87990b764d11f207ea0e8c6e93f7|`d0d4530a`> - ',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack>',
footer_icon: 'https://github.githubassets.com/favicon.ico',
Expand Down
5 changes: 5 additions & 0 deletions __tests__/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ github.context.workflow = dump.workflow
github.context.action = dump.action
github.context.actor = dump.actor

process.env.GITHUB_SHA = dump.sha
process.env.GITHUB_SERVER_URL = 'https://github.com'
process.env.GITHUB_REF = dump.ref
process.env.GITHUB_REPOSITORY = dump.repository

test('delete event to slack', async () => {
const mockAxios = new MockAdapter(axios, {delayResponse: 200})

Expand Down
86 changes: 86 additions & 0 deletions __tests__/fixtures/envvars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
ACTIONS_CACHE_URL = https://artifactcache.actions.githubusercontent.com/vYbmtabU4akFCdAnXD3NmnfhNFUM6zder6WPTPGVPndBPW2Pxw/
ACTIONS_RUNTIME_TOKEN = ***
ACTIONS_RUNTIME_URL = https://pipelines.actions.githubusercontent.com/vYbmtabU4akFCdAnXD3NmnfhNFUM6zder6WPTPGVPndBPW2Pxw/
AGENT_TOOLSDIRECTORY = /opt/hostedtoolcache
ANDROID_HOME = /usr/local/lib/android/sdk
ANDROID_SDK_ROOT = /usr/local/lib/android/sdk
ANT_HOME = /usr/share/ant
AZURE_EXTENSION_DIR = /opt/az/azcliextensions
BOOST_ROOT_1_72_0 = /opt/hostedtoolcache/boost/1.72.0/x64
CHROMEWEBDRIVER = /usr/local/share/chrome_driver
CHROME_BIN = /usr/bin/google-chrome
CI = true
CONDA = /usr/share/miniconda
DEBIAN_FRONTEND = noninteractive
DEPLOYMENT_BASEPATH = /opt/runner
DOTNET_MULTILEVEL_LOOKUP = "0"
DOTNET_NOLOGO = "1"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "1"
GECKOWEBDRIVER = /usr/local/share/gecko_driver
GITHUB_ACTION = self2
GITHUB_ACTIONS = true
GITHUB_ACTION_REF = v2
GITHUB_ACTION_REPOSITORY = actions/checkout
GITHUB_ACTOR = satterly
GITHUB_API_URL = https://api.github.com
GITHUB_BASE_REF =
GITHUB_ENV = /home/runner/work/_temp/_runner_file_commands/set_env_0350a8f5-3300-4bc1-a567-248825881d1a
GITHUB_EVENT_NAME = push
GITHUB_EVENT_PATH = /home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL = https://api.github.com/graphql
GITHUB_HEAD_REF =
GITHUB_JOB = test
GITHUB_PATH = /home/runner/work/_temp/_runner_file_commands/add_path_0350a8f5-3300-4bc1-a567-248825881d1a
GITHUB_REF = refs/heads/master
GITHUB_REPOSITORY = act10ns/slack
GITHUB_REPOSITORY_OWNER = act10ns
GITHUB_RETENTION_DAYS = 90
GITHUB_RUN_ID = 360703544
GITHUB_RUN_NUMBER = 760
GITHUB_SERVER_URL = https://github.com
GITHUB_SHA = f4c103c8121b97a235791468fd31ce98e89a5e9e
GITHUB_WORKFLOW = build-test
GITHUB_WORKSPACE = /home/runner/work/slack/slack
GOROOT = /opt/hostedtoolcache/go/1.14.11/x64
GOROOT_1_13_X64 = /opt/hostedtoolcache/go/1.13.15/x64
GOROOT_1_14_X64 = /opt/hostedtoolcache/go/1.14.11/x64
GOROOT_1_15_X64 = /opt/hostedtoolcache/go/1.15.4/x64
GRADLE_HOME = /usr/share/gradle
HOME = /home/runner
HOMEBREW_CELLAR = "/home/linuxbrew/.linuxbrew/Cellar"
HOMEBREW_PREFIX = "/home/linuxbrew/.linuxbrew"
HOMEBREW_REPOSITORY = "/home/linuxbrew/.linuxbrew/Homebrew"
INPUT_CHANNEL = #actions
INPUT_STATUS = in progress
INPUT_STEPS =
INVOCATION_ID = ec072f6aa5094730a9a12e654f96def2
ImageOS = ubuntu18
ImageVersion = 20201108.1
JAVA_HOME = /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
JAVA_HOME_11_X64 = /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
JAVA_HOME_12_X64 = /usr/lib/jvm/adoptopenjdk-12-hotspot-amd64
JAVA_HOME_7_X64 = /usr/lib/jvm/zulu-7-azure-amd64
JAVA_HOME_8_X64 = /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
JOURNAL_STREAM = 9:20663
LANG = C.UTF-8
LEIN_HOME = /usr/local/lib/lein
LEIN_JAR = /usr/local/lib/lein/self-installs/leiningen-2.9.4-standalone.jar
M2_HOME = /usr/share/apache-maven-3.6.3
PATH = /home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PERFLOG_LOCATION_SETTING = RUNNER_PERFLOG
PIPX_BIN_DIR = "/opt/pipx_bin"
PIPX_HOME = "/opt/pipx"
POWERSHELL_DISTRIBUTION_CHANNEL = GitHub-Actions-ubuntu18
RUNNER_DEBUG = 1
RUNNER_OS = Linux
RUNNER_PERFLOG = /home/runner/perflog
RUNNER_TEMP = /home/runner/work/_temp
RUNNER_TOOL_CACHE = /opt/hostedtoolcache
RUNNER_TRACKING_ID = github_e7d7b779-0024-4008-8ccf-1c5af8597894
RUNNER_USER = runner
RUNNER_WORKSPACE = /home/runner/work/slack
SELENIUM_JAR_PATH = /usr/share/java/selenium-server-standalone.jar
SLACK_WEBHOOK_URL = ***
SWIFT_PATH = /usr/share/swift/usr/bin
USER = runner
VCPKG_INSTALLATION_ROOT = /usr/local/share/vcpkg
7 changes: 6 additions & 1 deletion __tests__/release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ github.context.workflow = dump.workflow
github.context.action = dump.action
github.context.actor = dump.actor

process.env.GITHUB_SHA = dump.sha
process.env.GITHUB_SERVER_URL = 'https://github.com'
process.env.GITHUB_REF = dump.ref
process.env.GITHUB_REPOSITORY = dump.repository

test('release event to slack', async () => {
const mockAxios = new MockAdapter(axios, {delayResponse: 200})

Expand Down Expand Up @@ -51,7 +56,7 @@ test('release event to slack', async () => {
author_icon: 'https://avatars0.githubusercontent.com/u/615057?v=4',
mrkdwn_in: ['text'],
text:
'*<https://github.com/act10ns/slack/commit/21bd808031091c03bebc3472e13e91acd0b1de9e/checks|Workflow _build-test_ job _Build and Test_ triggered by _release_ is _Success_>* for <https://github.com/act10ns/slack/commit/21bd808031091c03bebc3472e13e91acd0b1de9e|`v1.0.6`>\n<https://github.com/act10ns/slack/commit/21bd808031091c03bebc3472e13e91acd0b1de9e|`21bd8080`> - new branch or tag',
'*<https://github.com/act10ns/slack/commit/21bd808031091c03bebc3472e13e91acd0b1de9e/checks|Workflow _build-test_ job _Build and Test_ triggered by _release_ is _Success_>* for <https://github.com/act10ns/slack/commits/v1.0.6|`v1.0.6`>\n<https://github.com/act10ns/slack/commit/21bd808031091c03bebc3472e13e91acd0b1de9e|`21bd8080`> - ',
fields: [],
footer: '<https://github.com/act10ns/slack|act10ns/slack>',
footer_icon: 'https://github.githubassets.com/favicon.ico',
Expand Down
Loading

0 comments on commit 0c47439

Please sign in to comment.