mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
Update scripts to use PULL_REQUEST_ID
This commit is contained in:
parent
81d346f006
commit
5e958f6074
4 changed files with 7 additions and 3 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -13,6 +13,10 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up PR environment
|
||||||
|
if: github.event.number != null
|
||||||
|
run: echo "::set-env name=PULL_REQUEST_ID::${{ github.event.number }}"
|
||||||
|
|
||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ MSG_NOT_MD='The file `%s` does not have a `.md` extension.\n'
|
||||||
|
|
||||||
PLATFORMS=$(ls pages/)
|
PLATFORMS=$(ls pages/)
|
||||||
|
|
||||||
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$PULL_REQUEST_ID" != "false" ]; then
|
||||||
check_diff
|
check_diff
|
||||||
check_structure
|
check_structure
|
||||||
else
|
else
|
||||||
|
|
|
@ -74,7 +74,7 @@ def main(action):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
REPO_SLUG = os.environ.get('GITHUB_REPOSITORY')
|
REPO_SLUG = os.environ.get('GITHUB_REPOSITORY')
|
||||||
PR_ID = os.environ.get('TRAVIS_PULL_REQUEST')
|
PR_ID = os.environ.get('PULL_REQUEST_ID')
|
||||||
BUILD_ID = os.environ.get('GITHUB_RUN_ID')
|
BUILD_ID = os.environ.get('GITHUB_RUN_ID')
|
||||||
|
|
||||||
if PR_ID is None or BUILD_ID is None or REPO_SLUG is None:
|
if PR_ID is None or BUILD_ID is None or REPO_SLUG is None:
|
||||||
|
|
|
@ -43,7 +43,7 @@ function run_checks_pr {
|
||||||
# MAIN
|
# MAIN
|
||||||
###################################
|
###################################
|
||||||
|
|
||||||
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$PULL_REQUEST_ID" != "false" ]; then
|
||||||
run_checks_pr
|
run_checks_pr
|
||||||
run_tests_pr
|
run_tests_pr
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue