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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xxnxx17
Copy link

@xxnxx17 xxnxx17 commented Mar 12, 2020

Reverts #35

@fkorotkov
Copy link
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')

echo "This is not a new comment event!"
exit $NEUTRAL_EXIT_CODE
fi

Choose a reason for hiding this comment

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

Mnnv

Copy link

@omar1326 omar1326 left a comment

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.

None yet

3 participants