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:
|
||||
build:
|
||||
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:
|
||||
- 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
|
||||
with:
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TRAVIS_REPO_SLUG: ${{ github.repository }}
|
||||
TRAVIS_BRANCH: master
|
||||
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
||||
PULL_REQUEST_ID: ${{ github.event.number }}
|
||||
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
|
||||
with:
|
||||
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:
|
||||
build:
|
||||
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:
|
||||
- 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
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
@ -11,11 +11,11 @@ set -e
|
||||
|
||||
echo "[收集] 计算 PR 分支与目标分支的分叉点……"
|
||||
|
||||
TARGET_BRANCH="${TRAVIS_BRANCH:-master}"
|
||||
TARGET_BRANCH="${GITHUB_BASE_REF:-master}"
|
||||
echo "[收集] 目标分支设定为:${TARGET_BRANCH}"
|
||||
|
||||
MERGE_BASE='HEAD^'
|
||||
[ "$TRAVIS_PULL_REQUEST" != 'false' ] \
|
||||
[ "$PULL_REQUEST_ID" != 'false' ] \
|
||||
&& MERGE_BASE="$(git merge-base "$TARGET_BRANCH" HEAD)"
|
||||
echo "[收集] 找到分叉节点:${MERGE_BASE}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user