Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Revert "Remove legacy checks inside entrypoint.sh"#38

Open
xxnxx17 wants to merge 1 commit into
cirrus-actions:masterfrom
xxnxx17:revert-35-fkorotkov-remove-legacy
Open

Revert "Remove legacy checks inside entrypoint.sh"#38
xxnxx17 wants to merge 1 commit into
cirrus-actions:masterfrom
xxnxx17:revert-35-fkorotkov-remove-legacy

Conversation

@xxnxx17

@xxnxx17 xxnxx17 commented Mar 12, 2020

Copy link
Copy Markdown

Reverts #35

@fkorotkov

Copy link
Copy Markdown
Member

@Meshari17 what is the reason behind the revert? Did you see that you can replicate the logic natively with the actions?

jobs:
  rebase:
    name: Rebase
    if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')

Comment thread entrypoint.sh
echo "This is not a new comment event!"
exit $NEUTRAL_EXIT_CODE
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mnnv

@omar1326 omar1326 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Workaround unitl new Actions support neutral strategy

See how it was before: https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#exit-codes-and-statuses

NEUTRAL_EXIT_CODE=0

skip if no /rebase

echo "Checking if comment contains '/rebase' command..."
(jq -r ".comment.body" "$GITHUB_EVENT_PATH" | grep -Fq "/rebase") || exit $NEUTRAL_EXIT_CODE

skip if not a PR

echo "Checking if issue is a pull request..."
(jq -r ".issue.pull_request.url" "$GITHUB_EVENT_PATH") || exit $NEUTRAL_EXIT_CODE

if [[ "$(jq -r ".action" "$GITHUB_EVENT_PATH")" != "created" ]]; then
echo "This is not a new comment event!"
exit $NEUTRAL_EXIT_CODE
IMG_20200408_200117_450

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants