Update Travis references in scripts

client-spec/clarity
Owen Voke 2020-06-09 15:03:35 +01:00 committed by Marco Bonelli
parent 2126dfec04
commit 7472600aa1
5 changed files with 16 additions and 16 deletions

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
# This script is executed by Travis CI for every successful push (on any branch, PR or not).
# This script is executed by GitHub Actions for every successful push (on any branch, PR or not).
set -ex
function initialize {
if [ -z "$TLDRHOME" ]; then
export TLDRHOME=${TRAVIS_BUILD_DIR:-$(pwd)}
export TLDRHOME=${GITHUB_WORKSPACE:-$(pwd)}
fi
export TLDR_ARCHIVE="tldr.zip"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This script is executed by Travis CI for every pull request opened.
# This script is executed by GitHub Actions for every pull request opened.
# It currently accomplishes the following objectives (for English pages only):
#
# 1. Detect pages that were just copied (i.e. cp pages/{common,linux}/7z.md).
@ -110,7 +110,7 @@ MSG_NOT_MD='The file `%s` does not have a `.md` extension.\n'
PLATFORMS=$(ls pages/)
if [ "$TRAVIS" = "true" ] && [ "$TRAVIS_REPO_SLUG" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
check_diff
check_structure
else

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
# This script is executed by Travis CI when a PR is merged (i.e. in the `deploy` step).
# This script is executed by GitHub Actions when a PR is merged (i.e. in the `deploy` step).
set -ex
function initialize {
if [ -z "$TLDRHOME" ]; then
export TLDRHOME=${TRAVIS_BUILD_DIR:-$(pwd)}
export TLDRHOME=${GITHUB_WORKSPACE:-$(pwd)}
fi
export TLDR_ARCHIVE="tldr.zip"
@ -13,8 +13,8 @@ function initialize {
export SITE_REPO_SLUG="tldr-pages/tldr-pages.github.io"
# Configure git.
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git config --global push.default simple
git config --global diff.zip.textconv "unzip -c -a"
@ -32,7 +32,7 @@ function upload_assets {
cd "$SITE_HOME"
git add -A
git commit -m "[TravisCI] uploaded assets after commits ${TRAVIS_COMMIT_RANGE}"
git commit -m "[GitHub Actions] uploaded assets after commits ${TRAVIS_COMMIT_RANGE}"
git push -q
echo "Assets (pages archive, index) deployed to static site."

View File

@ -8,7 +8,7 @@ import urllib.request
BOT_URL = 'https://tldr-bot.starbeamrainbowlabs.com'
COMMENT_ERROR="""
The [build](https://travis-ci.org/tldr-pages/tldr/builds/{build_id}) for this PR failed with the following error(s):
The [build](https://github.com/tldr-pages/tldr/actions/runs/{build_id}) for this PR failed with the following error(s):
```
{content}
@ -73,9 +73,9 @@ def main(action):
################################################################################
if __name__ == '__main__':
REPO_SLUG = os.environ.get('TRAVIS_REPO_SLUG')
REPO_SLUG = os.environ.get('GITHUB_REPOSITORY')
PR_ID = os.environ.get('TRAVIS_PULL_REQUEST')
BUILD_ID = os.environ.get('TRAVIS_BUILD_ID')
BUILD_ID = os.environ.get('GITHUB_RUN_ID')
if PR_ID is None or BUILD_ID is None or REPO_SLUG is None:
print('Needed environment variables are not set.', file=sys.stderr)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This script is executed by Travis CI for every successful push (on any branch, PR or not).
# This script is executed by GitHub Actions for every successful push (on any branch, PR or not).
# It runs some basic tests on pages. If the build is also a PR, additional
# checks are run through the check-pr script, and any message or error is sent
# to tldr-bot to be commented on the PR.
@ -14,7 +14,7 @@ function run_tests {
tldr-lint ./pages
}
# Special test function for Travis CI pull request builds.
# Special test function for GitHub Actions pull request builds.
# Runs run_tests collecting errors for tldr-bot.
function run_tests_pr {
errs=$(run_tests 2>&1)
@ -27,7 +27,7 @@ function run_tests_pr {
fi
}
# Additional checks for Travis CI pull request builds.
# Additional checks for GitHub Actions pull request builds.
# Only taken as suggestions, does not make the build fail.
function run_checks_pr {
msgs=$(bash scripts/check-pr.sh)
@ -43,7 +43,7 @@ function run_checks_pr {
# MAIN
###################################
if [ "$TRAVIS" = "true" ] && [ "$TRAVIS_REPO_SLUG" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$CI" = "true" ] && [ "$GITHUB_REPOSITORY" = "tldr-pages/tldr" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
run_checks_pr
run_tests_pr
else