-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathlocal-env.sh
More file actions
executable file
·34 lines (28 loc) · 914 Bytes
/
local-env.sh
File metadata and controls
executable file
·34 lines (28 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
#
# Sets some necessary variables up for local testing.
# JIRA_TOKEN, JIRA_USER and JIRA_BASE_URL still have to be set manually.
#
# Usage example:
# bash local-env.sh check-jira-release 3.73.0 ROX
#
export GITHUB_STEP_SUMMARY=/dev/stdout
export GITHUB_OUTPUT=/dev/stdout
GITHUB_ACTOR=$(git config --get user.email)
export GITHUB_ACTOR
GITHUB_REPOSITORY=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
export GITHUB_REPOSITORY
export GITHUB_SERVER_URL=https://github.com
main_branch=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
export main_branch
if [ -z "$DRY_RUN" ]; then
export DRY_RUN=true
fi
SCRIPTS_ROOT=$(git rev-parse --show-toplevel)/.github/workflows/scripts
CI="false" # true if running in GitHub context
export CI
# shellcheck source=./common.sh
source "$SCRIPTS_ROOT/common.sh"
SCRIPT="$SCRIPTS_ROOT/$1.sh"
shift
bash "$SCRIPT" "$@"