From 4f550268010eaf18b7713de5ee1fd94eb5959d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kalsnes=20Hagen?= <43886029+Snailedlt@users.noreply.github.com> Date: Wed, 18 Jan 2023 11:42:58 +0100 Subject: [PATCH] Check if PR base is develop (#1460) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Check if PR base is develop fix #1458 * Add PR base checker * Revert "Check if PR base is develop" This reverts commit aad0532114299916fdacd472ee04351905ac8678. Co-authored-by: Josélio Júnior <76992016+lunatic-fox@users.noreply.github.com> --- .github/workflows/check_icon_pr.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check_icon_pr.yml b/.github/workflows/check_icon_pr.yml index 6a57bab4..eb128cc3 100644 --- a/.github/workflows/check_icon_pr.yml +++ b/.github/workflows/check_icon_pr.yml @@ -7,12 +7,26 @@ jobs: if: startsWith(github.event.pull_request.title, 'new icon') || startsWith(github.event.pull_request.title, 'update icon') # only checks icon PR steps: - uses: actions/checkout@v2 + + - name: Check if PR is develop + if: ${{ github.base_ref != 'develop' }} + run: | + echo -e "The PR's base branch is \`${{ github.base_ref }}\`, but should be \`develop\`\nPlease change the PR so that it's based on, and merged into \`develop\`" > ./err_messages.txt + echo "wrong_branch=true" >> $GITHUB_ENV - uses: actions/setup-python@v2 + if: ${{ !env.wrong_branch }} with: python-version: 3.8 + - name: Install dependencies + if: ${{ !env.wrong_branch }} + run: | + python -m pip install --upgrade pip + pip install -r ./.github/scripts/requirements.txt + - name: Run the check_svg script + if: ${{ !env.wrong_branch }} env: PR_TITLE: ${{ github.event.pull_request.title }} run: python ./.github/scripts/check_icon_pr.py "$PR_TITLE" ./icons ./devicon.json