mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
feat: use github variable
This commit is contained in:
parent
d27ea5c8dc
commit
848e9cf058
9
.github/workflows/lctt-article-badge.yml
vendored
9
.github/workflows/lctt-article-badge.yml
vendored
@ -6,16 +6,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
TRAVIS_REPO_SLUG: ${{ github.repository }}
|
|
||||||
TRAVIS_BRANCH: master
|
|
||||||
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set ENV variables
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}"
|
|
||||||
echo "::set-env name=TRAVIS_EVENT_TYPE::$(if [ "schedule" == "${{ github.event_name }}" ]; then echo "cron"; else echo "${{ github.event_name }}"; fi)"
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
9
.github/workflows/lctt-article-checker.yml
vendored
9
.github/workflows/lctt-article-checker.yml
vendored
@ -7,15 +7,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TRAVIS_REPO_SLUG: ${{ github.repository }}
|
PULL_REQUEST_ID: ${{ github.event.number }}
|
||||||
TRAVIS_BRANCH: master
|
|
||||||
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set ENV variables
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}"
|
|
||||||
echo "::set-env name=TRAVIS_EVENT_TYPE::$(if [ "schedule" == "${{ github.event_name }}" ]; then echo "cron"; else echo "${{ github.event_name }}"; fi)"
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
9
.github/workflows/lctt-article-status.yml
vendored
9
.github/workflows/lctt-article-status.yml
vendored
@ -7,16 +7,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
TRAVIS_REPO_SLUG: ${{ github.repository }}
|
|
||||||
TRAVIS_BRANCH: master
|
|
||||||
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set ENV variables
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}"
|
|
||||||
echo "::set-env name=TRAVIS_EVENT_TYPE::$(if [ "schedule" == "${{ github.event_name }}" ]; then echo "cron"; else echo "${{ github.event_name }}"; fi)"
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
@ -11,11 +11,11 @@ set -e
|
|||||||
|
|
||||||
echo "[收集] 计算 PR 分支与目标分支的分叉点……"
|
echo "[收集] 计算 PR 分支与目标分支的分叉点……"
|
||||||
|
|
||||||
TARGET_BRANCH="${TRAVIS_BRANCH:-master}"
|
TARGET_BRANCH="${GITHUB_BASE_REF:-master}"
|
||||||
echo "[收集] 目标分支设定为:${TARGET_BRANCH}"
|
echo "[收集] 目标分支设定为:${TARGET_BRANCH}"
|
||||||
|
|
||||||
MERGE_BASE='HEAD^'
|
MERGE_BASE='HEAD^'
|
||||||
[ "$TRAVIS_PULL_REQUEST" != 'false' ] \
|
[ "$PULL_REQUEST_ID" != 'false' ] \
|
||||||
&& MERGE_BASE="$(git merge-base "$TARGET_BRANCH" HEAD)"
|
&& MERGE_BASE="$(git merge-base "$TARGET_BRANCH" HEAD)"
|
||||||
echo "[收集] 找到分叉节点:${MERGE_BASE}"
|
echo "[收集] 找到分叉节点:${MERGE_BASE}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user