Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add label event #18

Merged
merged 3 commits into from
Aug 15, 2022
Merged

add label event #18

merged 3 commits into from
Aug 15, 2022

Conversation

srz-zumix
Copy link
Owner

No description provided.

function label_event_envs() {
LABEL_COUNT=$(gh label list --json name --jq length)
if [ "${LABEL_COUNT}" == "0" ]; then
LABEL_COLOR="d73a4a"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
LABEL_COLOR appears unused. Verify use (or export if used externally). SC2034

LABEL_COUNT=$(gh label list --json name --jq length)
if [ "${LABEL_COUNT}" == "0" ]; then
LABEL_COLOR="d73a4a"
LABEL_DESCRIPTION="gh-act label"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
LABEL_DESCRIPTION appears unused. Verify use (or export if used externally). SC2034

if [ "${LABEL_COUNT}" == "0" ]; then
LABEL_COLOR="d73a4a"
LABEL_DESCRIPTION="gh-act label"
LABEL_NODE_ID=""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
LABEL_NODE_ID appears unused. Verify use (or export if used externally). SC2034

LABEL_COLOR="d73a4a"
LABEL_DESCRIPTION="gh-act label"
LABEL_NODE_ID=""
LABEL_IS_DEFAULT="false"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
LABEL_IS_DEFAULT appears unused. Verify use (or export if used externally). SC2034

LABEL_DESCRIPTION="gh-act label"
LABEL_NODE_ID=""
LABEL_IS_DEFAULT="false"
LABEL_NAME="gh act"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
LABEL_NAME appears unused. Verify use (or export if used externally). SC2034

ACT_ENV="${TEMPFILE_DIR}/.label.env"
gh label list --json \
color,description,id,isDefault,name,url \
--template '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Expressions don't expand in single quotes, use double quotes for that. SC2016

LABEL_NAME="{{$label.name}}"
LABEL_URL="{{$label.url}}"
' | filter_env > "${ACT_ENV}"
. "${ACT_ENV}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
ShellCheck can't follow non-constant source. Use a directive to specify location. SC1090

@@ -366,6 +395,9 @@ function create_event_json() {
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%B%-" | sed -e 's/$/\\\\n/g' | tr -d '\n' | sed -e 's/\\\\n$//g')
COMMITS=$(git log -1 --pretty=format:"{%n \"author\": {%n \"email\": \"%ae\",%n \"name\":\"%an\",%n \"username\":\"%an\"%n },%n \"committer\":{%n \"email\":\"%ce\",%n \"name\":\"%cn\",%n \"username\":\"%cn\"%n },%n \"distinct\":true,%n \"id\":\"%H\",%n \"message\":\"${COMMIT_MESSAGE}\",%n \"timestamp\":\"%cI\",%n \"tree_id\":\"%T\",%n \"url\":\"https://${GITHUB_HOSTNAME}/${OWNER}/${REPO}/commit/%H\"%n}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
COMMITS appears unused. Verify use (or export if used externally). SC2034

@@ -366,6 +395,9 @@ function create_event_json() {
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%B%-" | sed -e 's/$/\\\\n/g' | tr -d '\n' | sed -e 's/\\\\n$//g')
COMMITS=$(git log -1 --pretty=format:"{%n \"author\": {%n \"email\": \"%ae\",%n \"name\":\"%an\",%n \"username\":\"%an\"%n },%n \"committer\":{%n \"email\":\"%ce\",%n \"name\":\"%cn\",%n \"username\":\"%cn\"%n },%n \"distinct\":true,%n \"id\":\"%H\",%n \"message\":\"${COMMIT_MESSAGE}\",%n \"timestamp\":\"%cI\",%n \"tree_id\":\"%T\",%n \"url\":\"https://${GITHUB_HOSTNAME}/${OWNER}/${REPO}/commit/%H\"%n}")
fi
if [ "${EVENT_NAME}" == "label" ]; then
label_event_envs
fi
HEAD=$(git rev-parse HEAD)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
HEAD appears unused. Verify use (or export if used externally). SC2034

@@ -366,6 +395,9 @@ function create_event_json() {
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%B%-" | sed -e 's/$/\\\\n/g' | tr -d '\n' | sed -e 's/\\\\n$//g')
COMMITS=$(git log -1 --pretty=format:"{%n \"author\": {%n \"email\": \"%ae\",%n \"name\":\"%an\",%n \"username\":\"%an\"%n },%n \"committer\":{%n \"email\":\"%ce\",%n \"name\":\"%cn\",%n \"username\":\"%cn\"%n },%n \"distinct\":true,%n \"id\":\"%H\",%n \"message\":\"${COMMIT_MESSAGE}\",%n \"timestamp\":\"%cI\",%n \"tree_id\":\"%T\",%n \"url\":\"https://${GITHUB_HOSTNAME}/${OWNER}/${REPO}/commit/%H\"%n}")
fi
if [ "${EVENT_NAME}" == "label" ]; then
label_event_envs
fi
HEAD=$(git rev-parse HEAD)
BEFORE=$(git rev-parse HEAD^)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
BEFORE appears unused. Verify use (or export if used externally). SC2034

@srz-zumix srz-zumix merged commit ccb9f7d into main Aug 15, 2022
@srz-zumix srz-zumix deleted the feature/label branch August 15, 2022 15:18
@srz-zumix srz-zumix added the enhancement New feature or request label Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant